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!

Invalid MySQL result resource

Status
Not open for further replies.

LSWstudio

Programmer
Jul 14, 2003
6
DE
Hey,
Here is my problem friends. I created a dynamic site with PHP last year in school. I learned just enough SQL in the course to finish the project. It worked fine.

Now my host has moved servers, and the code now seems broken. I use an Apache server and MySQL (FovServ) on my PC and the code works fine. On the UNIX hosting server part of the code works, however the reading of the tables gives me basically these warnings rather than the info:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource

As said it works fine on my PC, just on the host server it gives me this and I can find no explanation why it suddenly does not work or the meaning of Invalid MySQL result resource?

Any suggestions or can anyone point me in the right direction, SQL was taught to me just as what I needed within my PHP course for this project. My SQL book has not been much help.

Thanks All

Kyle Lamson
 
Your post is somewhat misplaced. This is more of a Mysql/PHP issue.

Anyhow, the error messages indicates that the call to mysql_query does not succeed. As you don't show that part of the code I can't say anything specific about what the error may be.

To get a more meaningful error message use this code

Code:
$q = <your query>;
$c = mysql_query($q) or die(mysql_error() . 
&quot; when executing &quot; . $q);
 
Oh, ok, sorry if this is the wrong forum. I will withdraw it then.

Thanks for the help.

LSW
 
swampBoogie :
Thanks, I found a PHP forum and only had to go a few pages back to find the answer. Just what I needed, just a shove in the right direction.

My Mistake, I saw it as a SQL problem and not a PHP problem. Thanks again.

LSW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top