Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hey, At home I had a mysql serve

Status
Not open for further replies.

sjaakdelul

IS-IT--Management
Sep 19, 2002
43
NL
Hey,

At home I had a mysql server (3.23), PHP (4.2.2)and an apache server ... until the big crash :(

Now, I've saved my files at a server of a friend.
But when I run the scripts, I get the follow error:


"Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /var/ on line 12"


Line 12: while($object = mysql_fetch_object($query)){
Line 13: $gebruikersnaam = $object->gebruikersnaam;
Line 14: }

At another file, I got the almost the same error (now Mysql_fetch_array()):


"Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/ on line 114"


Line 114: while ($results_array = mysql_fetch_array($results)) {


At my server there weren't any mistakes ...
Does anyone know the meaning of the error?
 
That error is happening because your query is failing.

When a query fails, mysql_query() returns FALSE, which is not a valid result resource.

Test the variable in which you're storing the resource handle against FALSE. If it is FALSE, output the return of mysql_error() to see what is going wrong. Want the best answers? Ask the best questions: TANSTAAFL!
 
Can another version of apache or php be the reason for the problem?
 
Have you checked "register_globals =" setting in php.ini & tried it with them on vs off. ? It sounds like your variable $query is not getting passed.



Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top