note 52650 added to function.mysql-insert-id

From: Date: Sun, 08 May 2005 17:25:13 +0000
Subject: note 52650 added to function.mysql-insert-id
Groups: php.notes 
Request: Send a blank email to php-notes+get-89125@lists.php.net to get a copy of this message
Beware, mysql_insert_id() only returns the value of the last syntaxically correct insert statement. If your code has a problem and the insert is not understood by the server then the value of the last working insert command is returned. Put something else in place such as "select count( id ) from table" before and after the mysql_insert_id() call to ensure that a row was inserted. ---- Manual Page -- http://www.php.net/manual/en/function.mysql-insert-id.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+52650 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52650&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52650&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52650&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52650&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52650&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+52650&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#89125) next »