Results 1 to 4 of 4
Nov 2, 2010, 11:49 #1
- Join Date
- Jan 2002
- Swindon UK
- 0 Post(s)
- 0 Thread(s)
Get an id *immediately* after creating record?
Not sure of the best way to describe this, but I know what I'm after:
I've just created a record and it has a primary key - set to auto-increment.
Immediately after creating that record I need to make use of that id - which of course did not exist moments earlier - to insert a record into another table.
How can I get the result of the first query's addition to grab that id for use in the second update/insertion? Without having to do some barmy lookup against some other parameter (or a selection of them) that I think are unique enough to give me that newly created record's id?
Hope this makes sense!