ID: 46829 Updated by: j...@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