#30657 [Bgs->Asn]: mysqli_multi_query ignores SQL errors
| From: | georg@php.net | Date: | Fri, 05 Nov 2004 13:32:50 +0000 |
| Subject: | #30657 [Bgs->Asn]: mysqli_multi_query ignores SQL errors | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969364914@lists.php.net to get a copy of this message | ||
ID: 30657
Updated by: georg@php.net
Reported By: michael at kofler dot cc
-Status: Bogus
+Status: Assigned
-Bug Type: MySQLi related
+Bug Type: Documentation problem
Operating System: linux (suse 9.1)
PHP Version: 5CVS-2004-11-02 (dev)
-Assigned To:
+Assigned To: georg
New Comment:
mysql_multi_query only returns an error, if the 1st
statement failed.
To retrieve subsequent errors you have to use
mysqli_next_result.
-> Documentation bug
Previous Comments:
------------------------------------------------------------------------
[2004-11-02 15:19:48] georg@php.net
It's not a php bug.
See http://bugs.mysql.com/?id=6383
------------------------------------------------------------------------
[2004-11-02 10:13:42] michael at kofler dot cc
Description:
------------
with mysqli_multi_query I can execute several SQL commands at once;
if an error happens in the second or third or ... SQL command,
mysqli_multi_query returns TRUE, mysqli_error etc. contain no data on
the error
thus, it is impossible to detect and/or analyse errors in multi query
statements
Reproduce code:
---------------
$ok = mysqli->multi_query("SELECT 1; SELECT blabla");
Expected result:
----------------
$ok should be FALSE, $mysqli->error should specify error
(actually, $mysqli->error is inadequate; something like
$mysqli->multi_error would be better, returning an array with the error
messages for all statements)
Actual result:
--------------
$ok is TRUE
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30657&edit=1