|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46829 mysqli_multi_query() affects next query
Submitted: 2008-12-11 02:26 UTC Modified: 2009-01-13 01:00 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: dayseye at 21cn dot com Assigned:
Status: No Feedback Package: MySQLi related
PHP Version: 5.2.8 OS: WinXP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: dayseye at 21cn dot com
New email:
PHP Version: OS:


 [2008-12-11 02:26 UTC] dayseye at 21cn dot com
first, execute mysqli_multi_query() with some INSERT some rows in a 
then ,execute mysqli_query() to insert a row into ANOHTER;

execute mysqli_insert_id($link) get the newly inserted id, will 
return the first inserted id that from the firts 
mysqli_multi_query(). and the mysqli_query() is failed to insert 

Reproduce code:
mysqli_multi_query($link, "INSERT INTO `a` VALUES (NULL, 'Y'); INSERT INTO `a` VALUES (NULL, 'Y')");   //should return new id 31, 32

mysqli_query($link, "INSERT INTO `b` VALUES (NULL, 11, 'hello')"); //should return new id 12;

echo mysqli_insert_id($link);

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-05 12:13 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

 [2009-01-13 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Dec 08 04:01:27 2023 UTC