note 109548 deleted from function.pg-last-oid by aharvey
| From: | aharvey@php.net | Date: | Sun, 29 Jul 2012 02:34:05 +0000 |
| Subject: | note 109548 deleted from function.pg-last-oid by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-189447@lists.php.net to get a copy of this message | ||
Note Submitter: qeremy [atta] gmail [dotta] com
----
Simply getting LAST_INSERT_ID;
<?php
// Note: waiting for "select" part from pg_query below.
// Note: separating the query parts using semicolons (;).
$qry = pg_query("
INSERT INTO users (id,uname,upass,rep) VALUES (DEFAULT,'bubu','a981v',0.19);
SELECT Currval('users_id_seq') LIMIT 1
");
$fch = pg_fetch_row($qry);
print_r($fch);
?>
Array
(
[0] => 3 -> Gotcha!
)