|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35823 num_results property returns 0 when using prepared statements on MySQL 5.0
Submitted: 2005-12-27 23:59 UTC Modified: 2005-12-28 12:14 UTC
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: carlv at carlsoft dot net Assigned:
Status: Not a bug Package: MySQLi related
PHP Version: 5.1.1 OS: Windows XP
Private report: No CVE-ID: None
 [2005-12-27 23:59 UTC] carlv at carlsoft dot net
When using a prepared statement, the num_results will return 0  even if a result is returned.  I am using PHP 5.1 with MySQL 5.

Reproduce code:
				$stmt = $mysql->prepare('
										id = ?
				// a value is printed out here clearly indicating that a row is returned
				print $m_cur_start;

				if ($stmt->num_rows != 1) // this is always 0!

Expected result:
$stmt->num_rows should be 1, in this case.

Actual result:
$stmt->num_rows is always 0.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-28 00:01 UTC] carlv at carlsoft dot net
Sorry, my reproduction code contains a bug (left over when I was taking out unnecessary code).  Bind result should only have $m_cur_start in it.  But you get the idea.
 [2005-12-28 11:57 UTC]
Please try using this CVS snapshot:
For Windows:

 [2005-12-28 12:14 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Dec 10 11:01:26 2023 UTC