Req #54385 [Opn]: Mysqli_stmt->get_result() gives no error on failure
| From: | four dot zero dot one dot un dot authorized at gmail dot com | Date: | Fri, 25 Mar 2011 23:54:54 +0000 |
| Subject: | Req #54385 [Opn]: Mysqli_stmt->get_result() gives no error on failure | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-159788@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=54385&edit=1
ID: 54385
User updated by: four dot zero dot one dot un dot authorized at gmail
dot com
Reported by: four dot zero dot one dot un dot authorized at gmail
dot com
Summary: Mysqli_stmt->get_result() gives no error on failure
Status: Open
Type: Feature/Change Request
Package: MySQLi related
Operating System: ms
PHP Version: 5.3.6
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2011-03-25 23:28:03] four dot zero dot one dot un dot authorized at
gmail dot com
Description:
------------
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?
Thanks,
401
Test script:
---------------
$m = new Mysqli();
$s = $m->prepare("SELECT * FROM test where(id = ?)");
$v = 1;
$s->bind_param('i', $v);
$s->execute();
$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.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=54385&edit=1