#46829 [Opn]: mysqli_multi_query() affects next query
| From: | jani@php.net | Date: | Sun, 21 Dec 2008 13:06:58 +0000 |
| Subject: | #46829 [Opn]: mysqli_multi_query() affects next query | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-132216@lists.php.net to get a copy of this message | ||
ID: 46829
Updated by: jani@php.net
-Summary: mysqli_multi_query affect next query
Reported By: dayseye at 21cn dot com
Status: Open
Bug Type: MySQLi related
Operating System: WinXP
PHP Version: 5.2.8
New Comment:
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