PDA

View Full Version : Supplied argument is not a valid MySQL result resource


Bmath121
1-31-02, 08:31 PM
I am trying to run a script that I wrote and every time it gets to a certain line of code i get an error that says

Supplied argument is not a valid MySQL result resource

I went to that line and the line is:

$sql = mysql_query("SELECT * FROM roster where id=$id");


this runs fine on my local machine but not on thier server, please help!! I need to get this running.

btw

$sql = mysql_query("SELECT * FROM roster");
works fine but I am trying to only get a certain line.

thanks

Bryan

jfbell66
2-8-02, 12:54 PM
Well, either there is no column "id" on the server or the value held in $id is not a number or is empty (try checking the value of $id before querying the database). Try echo'ing mysql_error() right after the query and debug from there.


-John Bell
Programmer