Alan McDonald wrote:

>Do you know if this is true only in the same connection context only? Or
>does insert_id() return another connections last insert?
>  
>
I find it easiest to use MySQL's variables:

INSERT INTO Master ...
SELECT @MasterID:=last_insert_id();
INSERT INTO Detail1 (MasterID, Data) values (@MasterID, "...");
INSERT INTO Detail2 (MasterID, Data) values (@MasterID, "...");
... and so on and so forth.

-- 
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to