Cannot figure out this error
Moderator: General Moderators
Cannot figure out this error
***
Last edited by SFTLOLZ on Mon Jul 19, 2010 12:03 am, edited 2 times in total.
-
Aravinthan
- Forum Commoner
- Posts: 84
- Joined: Mon Jan 28, 2008 6:34 pm
Re: Cannot figure out this error
For the header,
It must be placed before the HTML tag.
For the MYSQL,
Must be:
It must be placed before the HTML tag.
For the MYSQL,
Code: Select all
$result= "SELECT * FROM `comments` WHERE id = `$id`";
Code: Select all
$result= "SELECT * FROM `comments` WHERE `id` = '$id'";
Re: Cannot figure out this error
Thanks for the response,
It is still returning this error
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home1/sftlolzc/public_html/likes.php on line 6
It is still returning this error
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home1/sftlolzc/public_html/likes.php on line 6
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Cannot figure out this error
No, look at what Aravinthan said about the query. Tick marks ` go around field names, quotes ' go around string values like $id. If you would carry on your or die() logic you would see that $result is not valid because your query failed.SFTLOLZ wrote:Thanks for the response,
It is still returning this error
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home1/sftlolzc/public_html/likes.php on line 6
Code: Select all
$result = "SELECT * FROM `comments` WHERE id = `$id`" or die(mysql_error());mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: Cannot figure out this error
I did it, I did it by typing it in, then copy and pasting. Same error both times.
-
Aravinthan
- Forum Commoner
- Posts: 84
- Joined: Mon Jan 28, 2008 6:34 pm
Re: Cannot figure out this error
Can you repost your code please?
Also make sure that there is a table colums with an field called id and a field called likes.
look for some type...
Also make sure that there is a table colums with an field called id and a field called likes.
look for some type...
Re: Cannot figure out this error
I figured it out, thank you for your help.