Computer ForumsComputers  

Go Back   Computer Forums > Programmers Lounge > Programming Discussions

Reply
 
LinkBack Thread Tools Display Modes
Old 07-29-2004, 08:41 AM   #1 (permalink)
Junior Techie
 
Join Date: Mar 2004
Posts: 56
Default MySQL errors. please help

mysql_fetch_array(): supplied argument is not a valid MySQL result resource

I keep getting the above error when entering the below code.

$result = mysql_query("SELECT , Message FROM LatestNews");
while ($row = mysql_fetch_array($result))
{
print "Message:".$row{'Message'}."
";
}


can anyone help?
hooloovoo is offline   Reply With Quote
Old 07-29-2004, 04:01 PM   #2 (permalink)
True Techie
 
Join Date: Apr 2004
Posts: 168
Default

Remove the comma from the line:

$result = mysql_query("SELECT , Message FROM LatestNews");

so it reads:

$result = mysql_query("SELECT Message FROM LatestNews");
__________________
--------------------

Nak

Is it just me, or does something smell suspicious about all this?
nak-1 is offline   Reply With Quote
Old 07-29-2004, 04:10 PM   #3 (permalink)
Junior Techie
 
Join Date: Mar 2004
Posts: 56
Default

duuurrrrrrr

Thanks for pointing out my stupidity. Its there as there were more fields, which were removed, but didnt remove the comma. Id have been on forever and not spotted that.

thanks
hooloovoo is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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

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



All times are GMT -5. The time now is 02:12 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0