Reply
What is wrong here?
Old 04-20-2004, 07:09 AM What is wrong here?
Super Talker

Posts: 121
i am getting this error

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/nanothre/public_html/guestbook/index.php on line 149

and this is the line of code it is referring to
PHP Code:
while($r mysql_fetch_array($resultMYSQL_NUM)) 
vegancoder is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 04-20-2004, 08:55 AM
Jcgeuze's Avatar
Skilled Talker

Posts: 93
Location: The Netherlands,
It would be more helpfull if you would paste the lines around this line too.

sometimes an error is reported at line x but the fault is line y.
Jcgeuze is offline
Reply With Quote
View Public Profile Visit Jcgeuze's homepage!
 
Old 04-20-2004, 09:36 AM
Novice Talker

Posts: 12
Location: New Zealand
Listen to him/her ^^
phreek is offline
Reply With Quote
View Public Profile Visit phreek's homepage!
 
Old 04-20-2004, 03:29 PM
Christopher's Avatar
Iced Cap

Latest Blog Post:
Unicode and Character Sets
Posts: 3,108
Location: Toronto, Ontario
The error means exactly what it says, $result is not a MySQL result resource meaning that there was probably an error with your query. As the messages above stated, try posting some more code to slim down your problem. When your executing your query its a good idea to stick some error handling in there as well, for example:

PHP Code:
$result mysql_query("SELECT * FROM mytable") or die("MySQL Error: " mysql_error()); 
Will display the mysql error, if there is one, and halt the script.
Christopher is offline
Reply With Quote
View Public Profile Visit Christopher's homepage!
 
Old 04-21-2004, 04:25 AM
Super Talker

Posts: 121
thanks for explaining what the error was, here is teh quesry code
PHP Code:
$query "SELECT name, email, message, date, FROM guestbook order by id DESC LIMIT 10";
$result mysql_query($query); 
vegancoder is offline
Reply With Quote
View Public Profile
 
Old 04-21-2004, 05:04 AM
Super Talker

Posts: 121
thanks for the help guys, i re-built my query and it works now here is my new query

PHP Code:
$query "SELECT `guestbook`.`name`, `guestbook`.`email`, `guestbook`.`message`, `guestbook`.`date`
FROM guestbook
ORDER BY `guestbook`.`id` DESC LIMIT 10"
;
$result mysql_query($query); 
vegancoder is offline
Reply With Quote
View Public Profile
 
Old 04-21-2004, 12:29 PM
j0e
Average Talker

Posts: 23
Location: UK
In case you wanted to know...

The problem was probably just because you have a comma before the FROM command which dosent need to be there.
j0e is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to What is wrong here?
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.15502 seconds with 13 queries