note 43729 deleted from function.pg-query by tomsommer
| From: | tomsommer@php.net | Date: | Thu, 01 Jul 2004 15:19:06 +0000 |
| Subject: | note 43729 deleted from function.pg-query by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-72265@lists.php.net to get a copy of this message | ||
Note Submitter:
----
useful function return last inserted value of given field
<?php
// by http://www.jetevents.pl
function pg_last_value($result, $table, $fieldname)
{
$oid = pg_last_oid($result);
$sql = "SELECT $fieldname FROM $table WHERE oid=$oid";
list($last_id) = pg_fetch_row(pg_query($sql));
return $last_id;
};
?>