note 21781 added to function.mysql-insert-id

From: Date: Sun, 26 May 2002 18:54:50 +0000
Subject: note 21781 added to function.mysql-insert-id
Groups: php.notes 
Request: Send a blank email to php-notes+get-31053@lists.php.net to get a copy of this message
Be sure to call mysql_insert_id() immediately after your call to mysql_query() to be sure that you get a valid value. A recent code I used called mysql_query() then checked for error values, number of rows, etc., and then mysql_insert_id() which returned nothing. Moving mysql_insert_id() after mysql_query() has fixed the bug. -- http://www.php.net/manual/en/function.mysql-insert-id.php http://master.php.net/manage/user-notes.php?action=edit+21781 http://master.php.net/manage/user-notes.php?action=delete+21781 http://master.php.net/manage/user-notes.php?action=reject+21781

« previous php.notes (#31053) next »