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 -> CodeChargeStudio.Discussion

 retrieve last given id with CCStudio

Print topic Send  topic

Author Message
Michael Sennewald
Posted: 08/15/2002, 11:31 PM

How can I get the last given id_number for an inserted record?
I need to use this id to create a filename associated with the id_number.

Michael



Alexey Alexapolsky
Posted: 08/16/2002, 12:38 AM

Please see a corresponding article in http://gotocode.com/artlist.asp

--

Alex,
Support Engineer
CodeCharge Team


"Michael Sennewald" <michael.sennewald@hummingbird.com> wrote in message
news:aji67v$7je$1@news.codecharge.com...
> How can I get the last given id_number for an inserted record?
> I need to use this id to create a filename associated with the id_number.
>
> Michael
>
>
>
>

Chip Cotton
Posted: 08/16/2002, 4:35 AM

You really should specify which language you're working in.

I've posted a message addressing this in PHP. You want to work in the
'after insert' event.

This was my solution to creating a matching record in a 2nd table when
a record was created in the first:

//AFTER INSERT EVENT OF RECORD FORM
global $long_articles_frm;
global $DBConnection1;
$last_id = mysql_insert_id();
//echo 'last insert id = ' . $last_id;
$sSQL2 = "insert into long_articles_bodies (" .
"lab_id," .
"lab_body)" .
" values (" .
$last_id . ",'" .
addslashes($long_articles_frm->lab_body->getvalue()) .
"')";
$DBConnection1->query($sSQL2);

On Fri, 16 Aug 2002 08:31:52 +0200, "Michael Sennewald"
<michael.sennewald@hummingbird.com> wrote:

>How can I get the last given id_number for an inserted record?
>I need to use this id to create a filename associated with the id_number.
>
>Michael
>
>
>
Kasper Pedersen
Posted: 12/04/2002, 8:15 AM

This usually works fine !

Usecase: Insertet a record in the table FOO

// AFTER INSERT START

$newID = CCDLookup("ID","FOO","1=1 ORDER BY ID DESC", [connection]);

// AFTER INSERT END

.... beware though of the THEORETICAL possiblity, that two of these
operations are executed at the same time ...

:-) Kasper


"Michael Sennewald" <michael.sennewald@hummingbird.com> wrote in message
news:aji67v$7je$1@news.codecharge.com...
> How can I get the last given id_number for an inserted record?
> I need to use this id to create a filename associated with the id_number.
>
> Michael
>
>
>
>


   


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

Web Database

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.