Alessandro
|
| Posted: 07/16/2002, 4:57 AM |
|
Hello,
in a record form I need to get the id of the created record just after its insertion. In Db (postgres) id is a serial value. I tried to add code in After Insert Events, as:
// Execute SQL statement
//-------------------------------
[cut]
$db->query("SELECT max(id) as max from table_name");
set_session("MaxID", $db->f("max"));
but it doesn't work.
Any hints? Thanks.
|
|
|
 |
Alex Alexapolsky
|
| Posted: 07/16/2002, 6:34 AM |
|
please refer to this article about retrieving this id in http://gotocode.com/artlist.asp
$db->query("SELECT max(id) as max from table_name");
if ($db->next_record()) {
set_session("MaxID", $db->f("max"));
}
|
|
|
 |
Alessandro
|
| Posted: 07/16/2002, 7:35 AM |
|
Excuse me, which article?
|
|
|
 |
Nicole
|
| Posted: 07/17/2002, 5:16 AM |
|
Hello,
the link is: http://www.gotocode.com/art.asp?art_id=80&
|
|
|
 |
|