Bug #10389 Updated: mysql_query(); returns an invalid result resource
| From: | cnewbill@php.net | Date: | Thu, 19 Apr 2001 00:26:15 +0000 |
| Subject: | Bug #10389 Updated: mysql_query(); returns an invalid result resource | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-51904@lists.php.net to get a copy of this message | ||
ID: 10389
Updated by: cnewbill
Reported By: pmarks@employees.org
Old-Status: Open
Status: Bogus
Bug Type: MySQL related
PHP Version: 4.0.4pl1
Assigned To:
Comments:
Your query is not returning any rows, and as such mysql_query returns false. False of course is not
a valid mysql result and thus the "Warning".
If you are 100% certain the query returns results then that would be a problem, otherwise this is
not a bug.
Please check this query from the mysql command line and reopen if there really is a problem.
-Chris
Previous Comments:
---------------------------------------------------------------------------
[2001-04-18 19:45:58] pmarks@employees.org
Here is the code I am using that produces the error:
<?php
$db = mysql_connect("localhost");
mysql_select_db("ue", $db);
$result = mysql_query("SELECT * FROM jobsc");
$rows = mysql_num_rows($result);
?>
on the last line is where the error is generated. In
any browser, I see:
Warning: Supplied argument is not a valid MySQL result
resource ...
My setup contains apache 1.3.19 with the static PHP 4.0.4pl1
module compiled in. My configure lines for PHP are:
./configure --with-apache=/home/apache_1.3.19
--with-mysql=/usr/local/mysql
/usr/local/mysql is the install directory for mysql
That is all the information I believe I have, and I'm
relatively sure that PHP is not crashing, per say.
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10389&edit=2