php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #30657 mysqli_multi_query ignores SQL errors
Submitted: 2004-11-02 10:13 UTC Modified: 2004-11-05 16:02 UTC
From: michael at kofler dot cc Assigned: georg (profile)
Status: Closed Package: Documentation problem
PHP Version: 5CVS-2004-11-02 (dev) OS: linux (suse 9.1)
Private report: No CVE-ID: None
 [2004-11-02 10:13 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-02 15:19 UTC] georg@php.net
It's not a php bug. 
See http://bugs.mysql.com/?id=6383 
 [2004-11-05 14:32 UTC] georg@php.net
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  
 [2004-11-05 16:02 UTC] georg@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jun 11 06:01:30 2024 UTC