Re: php/mysql error

From: Date: Wed, 21 Nov 2001 17:51:32 +0000
Subject: Re: php/mysql error
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-14515@lists.php.net to get a copy of this message
The error indicates that the result resource is invalid. The result resource in your example is $rs. Either this is not the variable that you used when sending the query or something went wrong with the query. You should always add "or die(mysql_error) to the end of your mysql_query statements, as it will give you a detailed message about what failed. Fred Jon <jons@dotnet.com> wrote in message news:Usenet.ipsiitnr@localhost... > please review my script > > I have already had it said that the script is fine, please check. IF > it is then I have a set up proiblem which I would also like help to > solve. BUT mysql outside of apache works fine. > > I started with an already set up apache so I don't know if mysql was > installed in right, but the staements before the error seem to work so > I would think so. > > I running my web server under red hat 7.0, I am new to apache/php and > mysql. > > Thanks > > ---------------------------- > > I get an error when it hits the line > > while ($row = mysql_fetch_row($rs)) {} > > I know it won't do anything, just checking each command. > > For a moment I thought this means that the mysql wan't compiled in but - > then how comes the other mysql_ statements don't error. > > anyway the error I get is this > Supplied argument is not a valid MySQL result resource ....... > > Now I am a C++ programmer so I am estimating here, it sounds like $row - > is wrong, do I need to set this up as an array (I believe that is what - > it is supposed to be) > > The $rs is right I am pretty sure and the command should do what I want- > it to do. > > > > >

« previous php.db (#14515) next »