|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19488 mysql_num_rows() randomly fails
Submitted: 2002-09-18 23:38 UTC Modified: 2002-09-19 05:41 UTC
From: chris-php at bolt dot cx Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 4.2.3 OS: Linux 2.4.19-pre4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
6 + 12 = ?
Subscribe to this entry?

 [2002-09-18 23:38 UTC] chris-php at bolt dot cx
mysql_num_rows() is randomly failing for me on any script with any SQL query. mysql_query() doesn't return false, and mysql_error() and mysql_errno() return nothing. Happens on both 4.2.2 and 4.2.3. I checked all SQL queries that this happens with and they run fine on the database server(s). The exact error message I get is:

[18-Sep-2002 21:31:46] PHP Warning:  mysql_num_rows(): supplied argument is not a valid MySQL result resource in /www/shared/sql.lib on line 99

(taken from the error_log)

The same thing seems to be happening on When I search for something, I randomly get the following errors:

Warning: mysql_numrows(): 4 is not a valid MySQL result resource in /local/Web/sites/php-bugs-web/search.php on line 119

Warning: mysql_fetch_array(): 4 is not a valid MySQL result resource in /local/Web/sites/php-bugs-web/search.php on line 139


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-19 05:41 UTC]
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.

 [2002-10-15 11:36 UTC] chris at luxmail dot lu
I have the same problem!
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 15 05:01:31 2024 UTC