LAST INSERT ID

Post Reply
rajesh11
Posts: 52
Joined: Fri Dec 16, 2005 7:41 am

LAST INSERT ID

Post by rajesh11 »

How can we get Last insert ID, if this ID is to be used in other child table.
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

LAST INSERT ID

Post by John »

The inserted values are returned, so if the first field is id then $id will be set as long as you do not use NOVARS, and you can do:

<SQL "insert into Table values(counter, ...)">
<SQL "insert into ChildTable values($id, ...)">
</SQL>
</SQL>
John Turnbull
Thunderstone Software
Post Reply