dbTalk Databases Forums  

How do I get the ID generated?

comp.databases.mysql comp.databases.mysql


Discuss How do I get the ID generated? in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
SpreadTooThin
 
Posts: n/a

Default How do I get the ID generated? - 01-28-2011 , 05:57 PM






If I add a row to a table that has an auto incremented ID that is a
foreign key in another table...
How do I get that ID from the last insert statement I generated?

Reply With Quote
  #2  
Old   
Jerry Stuckle
 
Posts: n/a

Default Re: How do I get the ID generated? - 01-28-2011 , 06:19 PM






On 1/28/2011 6:57 PM, SpreadTooThin wrote:
Quote:
If I add a row to a table that has an auto incremented ID that is a
foreign key in another table...
How do I get that ID from the last insert statement I generated?
http://www.lmgtfy.com/?q=mysql+insert+id

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex (AT) attglobal (DOT) net
==================

Reply With Quote
  #3  
Old   
SpreadTooThin
 
Posts: n/a

Default Re: How do I get the ID generated? - 01-28-2011 , 07:13 PM



On Jan 28, 5:19*pm, Jerry Stuckle <jstuck... (AT) attglobal (DOT) net> wrote:
Quote:
On 1/28/2011 6:57 PM, SpreadTooThin wrote:

If I add a row to a table that has an auto incremented ID that is a
foreign key in another table...
How do I get that ID from the last insert statement I generated?

http://www.lmgtfy.com/?q=mysql+insert+id

lol.. You suck.


Quote:
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck... (AT) attglobal (DOT) net
==================

Reply With Quote
  #4  
Old   
Jerry Stuckle
 
Posts: n/a

Default Re: How do I get the ID generated? - 01-28-2011 , 07:33 PM



On 1/28/2011 8:13 PM, SpreadTooThin wrote:
Quote:
On Jan 28, 5:19 pm, Jerry Stuckle<jstuck... (AT) attglobal (DOT) net> wrote:
On 1/28/2011 6:57 PM, SpreadTooThin wrote:

If I add a row to a table that has an auto incremented ID that is a
foreign key in another table...
How do I get that ID from the last insert statement I generated?

http://www.lmgtfy.com/?q=mysql+insert+id


lol.. You suck.


Then try googling your own answers next time. Or if you're too lazy,
pay a consultant to answer your questions for you.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex (AT) attglobal (DOT) net
==================

Reply With Quote
  #5  
Old   
Peter H. Coffin
 
Posts: n/a

Default Re: How do I get the ID generated? - 01-28-2011 , 08:31 PM



On Fri, 28 Jan 2011 15:57:25 -0800 (PST), SpreadTooThin wrote:
Quote:
If I add a row to a table that has an auto incremented ID that is a
foreign key in another table...
How do I get that ID from the last insert statement I generated?
We already covered that yesterday, if you read back in your own prior
thread.

--
53. If the beautiful princess that I capture says "I'll never marry
you! Never, do you hear me, NEVER!!!", I will say "Oh well" and
kill her.
--Peter Anspach's list of things to do as an Evil Overlord

Reply With Quote
  #6  
Old   
SpreadTooThin
 
Posts: n/a

Default Re: How do I get the ID generated? - 01-29-2011 , 09:23 AM



On Jan 28, 7:31*pm, "Peter H. Coffin" <hell... (AT) ninehells (DOT) com> wrote:
Quote:
On Fri, 28 Jan 2011 15:57:25 -0800 (PST), SpreadTooThin wrote:
If I add a row to a table that has an auto incremented ID that is a
foreign key in another table...
How do I get that ID from the last insert statement I generated?

We already covered that yesterday, if you read back in your own prior
thread.

--
53. If the beautiful princess that I capture says "I'll never marry
* * you! Never, do you hear me, NEVER!!!", I will say "Oh well" and
* * kill her.
* * * * --Peter Anspach's list of things to do as an Evil Overlord
Thanks I found it:
http://dev.mysql.com/doc/refman/5.0/...unique-id.html

Reply With Quote
  #7  
Old   
SpreadTooThin
 
Posts: n/a

Default Re: How do I get the ID generated? - 01-29-2011 , 09:41 AM



On Jan 28, 6:33*pm, Jerry Stuckle <jstuck... (AT) attglobal (DOT) net> wrote:
Quote:
On 1/28/2011 8:13 PM, SpreadTooThin wrote:

On Jan 28, 5:19 pm, Jerry Stuckle<jstuck... (AT) attglobal (DOT) net> *wrote:
On 1/28/2011 6:57 PM, SpreadTooThin wrote:

If I add a row to a table that has an auto incremented ID that is a
foreign key in another table...
How do I get that ID from the last insert statement I generated?

http://www.lmgtfy.com/?q=mysql+insert+id

lol.. You suck.

Then try googling your own answers next time. *Or if you're too lazy,
pay a consultant to answer your questions for you.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck... (AT) attglobal (DOT) net
==================
Thanks for the help Jerry...
http://www.velocityreviews.com/forum...y-stuckle.html

Reply With Quote
  #8  
Old   
SpreadTooThin
 
Posts: n/a

Default Re: How do I get the ID generated? - 01-29-2011 , 09:42 AM



On Jan 29, 8:23*am, SpreadTooThin <bjobrie... (AT) gmail (DOT) com> wrote:
Quote:
On Jan 28, 7:31*pm, "Peter H. Coffin" <hell... (AT) ninehells (DOT) com> wrote:

On Fri, 28 Jan 2011 15:57:25 -0800 (PST), SpreadTooThin wrote:
If I add a row to a table that has an auto incremented ID that is a
foreign key in another table...
How do I get that ID from the last insert statement I generated?

We already covered that yesterday, if you read back in your own prior
thread.

--
53. If the beautiful princess that I capture says "I'll never marry
* * you! Never, do you hear me, NEVER!!!", I will say "Oh well" and
* * kill her.
* * * * --Peter Anspach's list of things to do as an Evil Overlord

Thanks I found it:http://dev.mysql.com/doc/refman/5.0/...unique-id.html
I'm not sure that this will work in my environment... Which is
REALBasic.
I know this is the comp.database.mysql news group, but is this a SQL
neutral statement?

Reply With Quote
  #9  
Old   
Luuk
 
Posts: n/a

Default Re: How do I get the ID generated? - 01-29-2011 , 09:52 AM



On 29-01-11 16:41, SpreadTooThin wrote:
Quote:
On Jan 28, 6:33 pm, Jerry Stuckle <jstuck... (AT) attglobal (DOT) net> wrote:
On 1/28/2011 8:13 PM, SpreadTooThin wrote:

On Jan 28, 5:19 pm, Jerry Stuckle<jstuck... (AT) attglobal (DOT) net> wrote:
On 1/28/2011 6:57 PM, SpreadTooThin wrote:

If I add a row to a table that has an auto incremented ID that is a
foreign key in another table...
How do I get that ID from the last insert statement I generated?

http://www.lmgtfy.com/?q=mysql+insert+id

lol.. You suck.

Then try googling your own answers next time. Or if you're too lazy,
pay a consultant to answer your questions for you.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck... (AT) attglobal (DOT) net
==================

Thanks for the help Jerry...
http://www.velocityreviews.com/forum...y-stuckle.html
You should not tease Jerry, his company does exist...
http://www.manta.com/c/mmd74gb/jds-c...-training-corp
(if its the company mentioned at that link)

--
Luuk

Reply With Quote
  #10  
Old   
Peter H. Coffin
 
Posts: n/a

Default Re: How do I get the ID generated? - 01-29-2011 , 12:05 PM



On Sat, 29 Jan 2011 07:42:30 -0800 (PST), SpreadTooThin wrote:
Quote:
I'm not sure that this will work in my environment... Which is
REALBasic.
I know this is the comp.database.mysql news group, but is this a SQL
neutral statement?
It's a mysql-only statement, but the sql version (the non-api version)
is application-neutral, and even works if you're using the CLI and
Expect or something. Many other RDBMSs have their own mechanism to
accomplish the same thing though.

--
When all you have is a hammer, every problem looks like a messiah.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.