NOT valid MySQL result resource ????

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
derek233
Forum Newbie
Posts: 6
Joined: Sat Feb 07, 2004 12:07 am

NOT valid MySQL result resource ????

Post by derek233 »

i am getting this error:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/derek233/www/rocreation/userRoutes.php on line 30

my php (line 28,29, and 30) looks like this:

$query = "SELECT * FROM routeData ";
$result = mysql_query($query);
$numRoutes = mysql_num_rows($result);

here is the actual error ocurring online:
http://www.zoorasta.com/rocreation/userMain.html

The above code works on my local Apache web server, but when i upload the php to phpwebhosting.com i am getting this error. Can anyone explain this????
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Try:
$result = mysql_query($query) or die(mysql_error());
derek233
Forum Newbie
Posts: 6
Joined: Sat Feb 07, 2004 12:07 am

Post by derek233 »

YOU ROCK :D

Ok, the problem was the table name was Case sensitive on their server. So, calling routedata was not the same as calling routeData.

Thanks this forum ROCKS!!!!
Post Reply