Gossamer Forum
Home : General : Databases and SQL :

PHP/MySQL problem

Quote Reply
PHP/MySQL problem
I had a corruption problem with the built in MySQL server and I installed a new copy of mysql on another dir. It works ok for my perl scripts but not for my php one...
I get this error from this script

Supplied argument is not a valid MySQL result resource
this error is referring to this line
while($r=mysql_fetch_array($lists)){

Supplied argument is not a valid MySQL result resource
his error is referring to this line
$res=mysql_fetch_array(mysql_query("SELECT * FROM pages WHERE name='$name'"));

The author of this script says that this is a problem of the MySQL install...
Thanks
Max
Max
The one with Mac OS X Server 10.4 :)

Last edited by:

maxpico: Sep 20, 2002, 9:13 AM
Quote Reply
Re: [maxpico] PHP/MySQL problem In reply to
Your PHP syntax appears to be correct, but it's tough to know for sure without seeing those lines in a larger context. For example - on the first error, obviously it's telling you that $lists isn't a MySQL result set. Are you sure that it's successfully querying the database to get that result set in the first place? That could be a problem with your connection or with your syntax on the initial query that generates $lists.

Then again, if this is a script that you've used successfully in the past, then that would seem to indicate that the problem is indeed in the MySQL installation. In that case, you'll need troubleshooting guidance from someone far more experienced than I...

Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund