note 31568 added to function.pg-last-oid

From: Date: Sat, 26 Apr 2003 12:09:32 +0000
Subject: note 31568 added to function.pg-last-oid
Groups: php.notes 
Request: Send a blank email to php-notes+get-47133@lists.php.net to get a copy of this message
-------------------------------------------------------- You couldn't this. Becouse test_id_seq may be changed? -------------------------------------------------------- >>> You could use this to get the last insert id... >>> >>> CREATE TABLE test ( >>> id serial, >>> something int not null >>> ); >>> >>> This creates the sequence test_id_seq. >>> Now do the following after inserting something into table test: >>> >>> INSERT INTO test (something) VALUES (123); >>> SELECT currval('test_id_seq') AS lastinsertid; >>> >>> lastinsertid should contain your last insert id. -------------------------------------------------------- You couldn't this. Becouse test_id_seq may be changed? -------------------------------------------------------- -- http://www.php.net/manual/en/function.pg-last-oid.php http://master.php.net/manage/user-notes.php?action=edit+31568 http://master.php.net/manage/user-notes.php?action=delete+31568 http://master.php.net/manage/user-notes.php?action=reject+31568

« previous php.notes (#47133) next »