Forum: PHP 2 Days Ago |
| Replies: 5 Views: 159 The first notice you get is because $_POST[dtext] may not have been set. This will result in an invalid query, after which it will fail, and put false in $result.
Since $result is false (because... |
Forum: PHP 2 Days Ago |
| Replies: 3 Views: 189 Then you could use this one:
SELECT * FROM agents WHERE (sponsor = '1' or sponsor = '2' or sponsor = '3') LIMIT 1 |
Forum: PHP 3 Days Ago |
| Replies: 14 Views: 281 Got your PM too, but the question was already nicely answered. |
Forum: PHP 3 Days Ago |
| Replies: 14 Views: 281 I suggest you read this first: http://www.daniweb.com/forums/announcement124-2.html
Come up with an idea. Then, if you have problems, show us your code and explain the problem. |
Forum: PHP 3 Days Ago |
| Replies: 4 Views: 143 Try this:
<?php
mysql_connect(HOST,USER,PASS);
@mysql_select_db("db303278079") or die( "Unable to select database");
$query="select * from ".RECORDS." WHERE area='manchester' order... |
Forum: PHP 3 Days Ago |
| Replies: 4 Views: 143 The if ($count) is inside the for loop, which doesn't get executed if there are no records found. Place the if ($count == 0) outside the for loop to fix it. |
Forum: PHP 3 Days Ago |
| Replies: 3 Views: 189 The LIMIT always applies to the end result of the query. Even without the limit, the count(*) will only return 1 result row.
I'm not sure of what you try to achieve. If you want the count per... |
Forum: PHP 11 Days Ago |
| Replies: 4 Views: 207 The mysql_fetch_array function does this. It retrieves the table columns by id AND by name. You can use mysql_fetch_row instead. |
Forum: PHP 17 Days Ago |
| Replies: 7 Views: 330 Are you perhaps using the escape twice before storing the value in the db ? The slash shouldn't be in there. |
Forum: PHP 18 Days Ago |
| Replies: 7 Views: 330 The mysql_real_escape_string is intented to be used when you include a variable into an sql statement. You are just displaying the result. That is why you are shown a value with the extra slashes.
... |
Forum: PHP 18 Days Ago |
| Replies: 4 Views: 215 There may be something in session.php or config.php that adds spaces to the output (or more). |
Forum: PHP 24 Days Ago |
| Replies: 8 Views: 378 Why not let the browser handle it:
<?php
echo '<a href="mailto:' . $row_master_view['email'] . '">' . $row_master_view['email'] . '</a>';
?> |
Forum: PHP 29 Days Ago |
| Replies: 8 Views: 235 Then it must be this new page, something has to be missing, if all others work.
Before the while, add: die(mysql_error()); to see if and why the query fails. |
Forum: PHP 29 Days Ago |
| Replies: 8 Views: 235 Check if the connection to the database is successful (in code). |
Forum: PHP 29 Days Ago |
| Replies: 8 Views: 235 What happens when the query fails, and $result is false, instead of a resource ? My guess is that there is an error in the query or it's not connecting correctly. |
Forum: PHP Oct 23rd, 2009 |
| Replies: 4 Views: 408 $id is not set. Put the following on line 5:
$id = $_GET['id']; |
Forum: PHP Oct 23rd, 2009 |
| Replies: 4 Views: 530 If you really need to do this this way, then creating a msqli_multi_query could help. That way the server gets all queries at once, and does not need to handle each query separately.
... |
Forum: PHP Oct 17th, 2009 |
| Replies: 6 Views: 581 $members->start();
This requires that $members is an object, created with:
$members = new <classname>;
Where <classname> is the class you want it to be (probably db). |
Forum: PHP Oct 15th, 2009 |
| Replies: 1 Views: 228 <?php
include_once(DIR_WS_LANGUAGES . $_SESSION['language'] . '.php') ;
?> |
Forum: PHP Oct 13th, 2009 |
| Replies: 5 Views: 320 You could add
AddType application/x-httpd-php .html
to your htaccess files. Then, html files will be parsed just the same as php files. So you can add php code to the html files. |
Forum: PHP Oct 13th, 2009 |
| Replies: 2 Views: 268 Insert this at the top of both pages:
if (! session_id())
session_start();
Then you can use
$_SESSION['first'] = $_POST['first']; |
Forum: PHP Oct 8th, 2009 |
| Replies: 6 Views: 273 Check this line: header("Content-length: " . filesize( $getfile ));
Maybe filesize cannot find your file and returns 0. You may have to use $filepath instead. I think you need to output the file... |
Forum: PHP Oct 7th, 2009 |
| Replies: 8 Views: 425 His example only contains '128px', post #4 splits that fine.
Once you introduce other chars into the equasion, I think it's best to remove them first. I'll wait for feedback first from baltazar,... |
Forum: PHP Oct 7th, 2009 |
| Replies: 8 Views: 425 $test = preg_split('/px|em|pt|%/',$str,-1, PREG_SPLIT_OFFSET_CAPTURE);
You should put your regex between slashes. Is this what you want ? Perhaps you want to split also before a number ?
... |
Forum: PHP Oct 7th, 2009 |
| Replies: 8 Views: 425 He wants to split his string on 'px' or 'em' or 'pt' or '%'
I made it a backreference, but it is probably not necessary.
The code should be:
$test = preg_split('/px|em|pt|%/', '128px', -1,... |
Forum: PHP Oct 7th, 2009 |
| Replies: 8 Views: 425 |
Forum: PHP Oct 5th, 2009 |
| Replies: 6 Views: 214 sorry, remove the echo before the if... |
Forum: PHP Oct 5th, 2009 |
| Replies: 1 Views: 171 It shouldnt be a problem. Try:
mysql_query(...) or die(mysql_error());
to see why the query fails. |
Forum: PHP Oct 5th, 2009 |
| Replies: 2 Views: 191 $this_banner[dsub] is probably returning a string instead of an integer. If you're sure it is an integer you can try:
(int)$this_banner[dsub]
otherwise, check it's contents. |
Forum: PHP Oct 5th, 2009 |
| Replies: 6 Views: 214 The echo is the 13th option. Try this:
<select name="month" id="month">
<option value="1" <?php echo if ($this_month == 'Jan') echo 'selected'; ?>>Jan</option>
<option value="2" <?php echo... |
Forum: PHP Oct 5th, 2009 |
| Replies: 6 Views: 214 |
Forum: PHP Oct 1st, 2009 |
| Replies: 2 Views: 314 TinyMCE has a plugin to handle images:
http://tinymce.moxiecode.com/plugins_imagemanager.php |
Forum: PHP Sep 30th, 2009 |
| Replies: 9 Views: 349 try using & #35 ; instead (without the spaces),
see:
http://www.ascii.cl/htmlcodes.htm |
Forum: PHP Sep 18th, 2009 |
| Replies: 7 Views: 327 $sql = ("SELECT * FROM persons1 WHERE Firstname=' . $post_Firstname . '");
should be
$sql = ("SELECT * FROM persons1 WHERE Firstname='$post_Firstname'"); |
Forum: PHP Sep 17th, 2009 |
| Replies: 7 Views: 327 Add the line:
$Firstname = $_POST['Firstname'];
before the line with mysql_select_db. |
Forum: PHP Sep 17th, 2009 |
| Replies: 2 Views: 277 Replace
$res = mysql_query($sql) or die("cud not add record");
with
$res = mysql_query($sql) or die(mysql_error());
and paste the error message too. |
Forum: PHP Sep 16th, 2009 |
| Replies: 7 Views: 279 Not sure, if I put this:
<button type="button" onclick="window.location='bookview.php?id=1&hn'">Book Now</button>
in a test.html file it tries to open bookview.php
Are you missing something... |
Forum: PHP Sep 16th, 2009 |
| Replies: 7 Views: 279 |
Forum: PHP Sep 15th, 2009 |
| Replies: 5 Views: 1,041 http://code.google.com/apis/ajaxsearch/documentation/reference.html#_class_GSearch
See the "Searchers" section. Appears to be limited to 4 or 8. |
Forum: PHP Sep 15th, 2009 |
| Replies: 5 Views: 1,041 According to the section "PHP Access" in http://code.google.com/apis/ajaxsearch/documentation/#The_Basics it should be possible.
My guess is you already tried this. At work we use the paid... |