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

invalid MySQL resource

Status
Not open for further replies.

Inssider

Technical User
Aug 24, 2000
49
US
For some reason, I'm getting a:

Warning: Supplied argument is not a valid MySQL result resource in library.php on line 6

whenever I run my script. It occurs whenever I try to use the mysql_numrows function or the mysql_result function (those are the two I was using). Does anyone know why? [sig][/sig]
 
It probably means the mysql user you have chosen to run the script doesn't have rights to these resources. Or you have supplied the wrong user/password/hostname combination. Can you log in from the command line and run the same queries as that user? [sig][/sig]
 
The thing is, my other scripts work fine. They all connect to the database using the same config file, and the other scripts work flawlessly. But when I try to create another script, I get the result resource errors. [sig][/sig]
 
Are you saying it's only when you use 'mysql_numrows' function or the 'mysql_result' function? [sig][/sig]
 
No, but those were the two I was using at the time.

However, I fixed the problem by adding the function code inline, instead of in a separate object created in an include file. It works now, but I'd still like to know why it was happening when I stuck the function code in the class. [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top