note 31521 added to function.mysql-insert-id

From: Date: Thu, 24 Apr 2003 19:36:43 +0000
Subject: note 31521 added to function.mysql-insert-id
Groups: php.notes 
Request: Send a blank email to php-notes+get-47042@lists.php.net to get a copy of this message
This might be obvious, but it tripped me up - be careful when using last_insert_id() with persistent connections - running last_insert_id() after a failed update/insert/etc will return the last insert id of the last successful update/insert made by that CONNECTION rather than 0 for the number of rows updated by the previous non-working query, and who knows what the last query run on that connection was. -- http://www.php.net/manual/en/function.mysql-insert-id.php http://master.php.net/manage/user-notes.php?action=edit+31521 http://master.php.net/manage/user-notes.php?action=delete+31521 http://master.php.net/manage/user-notes.php?action=reject+31521

« previous php.notes (#47042) next »