note 41683 added to function.pg-last-oid

From: Date: Mon, 19 Apr 2004 19:28:40 +0000
Subject: note 41683 added to function.pg-last-oid
Groups: php.notes 
Request: Send a blank email to php-notes+get-68339@lists.php.net to get a copy of this message
The sequence functions for autonumbering can be read like an ordinary table. ex. "select * from request_id_seq"; which returns all the current values for the sequence. To get the last id number entered use "select last_value from request_id_seq"; To have the query pull the values of the record with the last id, use a query with a subselect statement. ex. "SELECT id, date_requested, time_requested, requestor_name, requestor_email, requestor_phone FROM request where id = (select last_value from request_id_seq)"; ---- Manual Page -- http://www.php.net/manual/en/function.pg-last-oid.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+41683 Delete -- http://master.php.net/manage/user-notes.php?action=delete+41683&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+41683&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#68339) next »