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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP & MySQL

Status
Not open for further replies.

RichOrlando

Technical User
Nov 20, 2002
2
0
0
US
I'm working with a PHP/MySQL setup, with several scripts that were passed along to me (so I can't claim to have written them from scratch). I get the same error: "Supplied argument is not a valid MySQL result resource in ....(global path).... on line XX"

Line XX in each of my scripts is a while loop:
While ($myrow = mysql_fetch_row ($result))

Is this too generic of a question to ask without actually seeing my code?
 
Typically, the line before mysql_fetch_*() is mysql_query(). mysql_query() returns a resource handle (which can be empty) if the function was able to perform your query, or FALSE if there was an error.

The most common cause of "invalid resource handle" is that mysql_query() is failing and returning FALSE, but the code doesn't catch that error and tries to use FALSE to get data from the server. ______________________________________________________________________
TANSTAAFL!
 
The Error is in you query's syntax.
Echo out your query, copy and paste it into your mysql client program.
This will give aditional help debuging the query Thanx Dave Shaw!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top