View Single Post

   
  #2 (permalink)  
Old 03-01-2008, 03:49 PM
Erick T. Barkhuis
 
Posts: n/a
Default Re: How do I know the auto-generated key in a newly-inserted row?

bk:

> INSERT INTO Authors (fName, lName) VALUES ("Kurt", "Vonnegut");
> INSERT INTO Books (Authors.id, title) VALUES (???, "Slapstick");
>
> The ??? in the second insert is where I need help.


In case you're using PHP, have a look at mysql_insert_id()

--
Erick
Reply With Quote