CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Use of record id

Print topic Send  topic

Author Message
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&

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.