MySQL resource
| From: | David Otton | Date: | Thu, 11 Oct 2001 16:21:09 +0000 |
| Subject: | MySQL resource | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-70825@lists.php.net to get a copy of this message | ||
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