|  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
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:
49 - 38 = ?
Subscribe to this entry?

 [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-2024 The PHP Group
All rights reserved.
Last updated: Sun Mar 03 00:01:29 2024 UTC