eene
> Cc: [EMAIL PROTECTED]
> Subject: Re: Auto Increment ID of Inserted Row
>
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Dan Greene wrote:
>
> > (newbie to MySQL)
> >
> > I've been banging my head against the wall on this one for
>
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Dan Greene wrote:
> (newbie to MySQL)
>
> I've been banging my head against the wall on this one for a bit now,
and I understand that last_insert_id() is per-connection based, but most
webapps are connection pooled (simple) or clustered (harder). Wha
(newbie to MySQL)
I've been banging my head against the wall on this one for a bit now, and I understand
that last_insert_id() is per-connection based, but most webapps are connection pooled
(simple) or clustered (harder). What are my options to get the id of the inserted row
in a webapp? As a
In the last episode (Sep 19), Steven Kreuzer said:
> >What is the SQL to get the created AutoInc ID from a row that I have
> >just inserted?
>
> SELECT MAX(id_field) FROM table
Nope. If someone else inserted a record between the time you inserted
yours and the time you run that select, your answ
not be id you are expecting.
Regards,
Michael
-Original Message-
From: Steven Kreuzer [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 19, 2002 10:24 AM
To: Davis, Tim
Cc: Mysql (E-mail)
Subject: Re: Auto Increment ID of Inserted Row
SELECT MAX(id_field) FROM table
SK
On Thursday
From: Steven Kreuzer <[EMAIL PROTECTED]>
> SELECT MAX(id_field) FROM table
> On Thursday, September 19, 2002, at 12:55 PM, Davis, Tim wrote:
> > What is the SQL to get the created AutoInc ID from a row that I
> > have just inserted?
More formally, you can do this:
SELECT LAST_INSERT_ID();
-
At 13:23 -0400 9/19/02, Steven Kreuzer wrote:
>SELECT MAX(id_field) FROM table
That won't give you the correct answer if some other client gets in
there an inserts a row before you have a change to get the MAX()
value. LAST_INSERT_ID() is designed for this; it's not affected
by whatever other cl
SELECT MAX(id_field) FROM table
SK
On Thursday, September 19, 2002, at 12:55 PM, Davis, Tim wrote:
> What is the SQL to get the created AutoInc ID from a row that I have
> just
> inserted?
>
> Tim Davis
> Sunbelt Systems Concepts, Inc
> [EMAIL PROTECTED]
> Client/Server Database Programmer/Ana
At 12:55 -0400 9/19/02, Davis, Tim wrote:
>What is the SQL to get the created AutoInc ID from a row that I have just
>inserted?
SELECT LAST_INSERT_ID();
Seems like there's an echo in here...this question has been asked about
4 times in the last couple of days. :-)
>
>Tim Davis
>Sunbelt Syste
What is the SQL to get the created AutoInc ID from a row that I have just
inserted?
Tim Davis
Sunbelt Systems Concepts, Inc
[EMAIL PROTECTED]
Client/Server Database Programmer/Analyst
-
Before posting, please check:
http://w
10 matches
Mail list logo