|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #54385 Mysqli_stmt->get_result() gives no error on failure
Submitted: 2011-03-25 23:28 UTC Modified: 2011-03-26 05:30 UTC
From: four dot zero dot one dot un dot authorized at gmail dot com Assigned:
Status: Not a bug Package: MySQLi related
PHP Version: 5.3.6 OS: ms
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:
19 + 47 = ?
Subscribe to this entry?

 [2011-03-25 23:28 UTC] four dot zero dot one dot un dot authorized at gmail dot com
Though mysqli_stmt->get_result() returns false on failure as expected, it doesn't also generate an error on failure.  Can warning-level errors be added to help explain when/why a get fails?


Test script:
$m = new Mysqli();
$s = $m->prepare("SELECT * FROM test where(id = ?)");
$v = 1;
$s->bind_param('i', $v);
$s->store_result(); // cause of get_result's failure
$r = $s->get_result();

Expected result:
Warning-level error on get_result() line 9 explaining why results failed to return from method call, or at the very least a warning stating a failure of some kind occurred.

Actual result:
No warning generated.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-26 00:54 UTC] four dot zero dot one dot un dot authorized at gmail dot com
Actually, my bad.  You can close this.  I just found that the error "2014 Commands out of sync; you can't run this command now" is already stored in the main Mysqli object error properties after running the code example.  This works.
 [2011-03-26 05:30 UTC]
-Status: Open +Status: Bogus
 [2011-03-26 05:30 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-2022 The PHP Group
All rights reserved.
Last updated: Tue May 17 03:03:35 2022 UTC