#46829 [Opn->Fbk]: mysqli_multi_query() affects next query
| From: | jani@php.net | Date: | Mon, 05 Jan 2009 12:13:55 +0000 |
| Subject: | #46829 [Opn->Fbk]: mysqli_multi_query() affects next query | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-132560@lists.php.net to get a copy of this message | ||
ID: 46829
Updated by: jani@php.net
Reported By: dayseye at 21cn dot com
-Status: Open
+Status: Feedback
Bug Type: MySQLi related
Operating System: WinXP
PHP Version: 5.2.8
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2008-12-11 02:26:12] dayseye at 21cn dot com
Description:
------------
first, execute mysqli_multi_query() with some INSERT some rows in a
table;
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
data.
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:
----------------
12
Actual result:
--------------
31
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46829&edit=1