Re: MySQL resource

From: Date: Fri, 12 Oct 2001 00:33:27 +0000
Subject: Re: MySQL resource
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-70866@lists.php.net to get a copy of this message
On Fri, 12 Oct 2001 01:51, David Otton wrote: > Ok.... this is irritating. > > Essentially, my code (in a class) is doing this : > > > > $result = mysql_query($query, $this->connection); > > if ($result) { > echo (mysql_num_rows($result)); > } > > > > The way I read the manual, the if() only fires off if the query is > executed, and then by definition mysql_num_rows() should contain at > least a 0. So why do I get this error? > > Warning: Supplied argument is not a valid MySQL result resource in > C:\blah\class_test.inc on line 195 > > If I echo($result) it comes back as > > 1 > > djo Stick an echo mysql_error() after your query and see if anything results. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA My other car is a broom!

« previous php.general (#70866) next »