Re: Nested inserts possible?

2010-03-12 Thread mos
Keith, You will need to reference the mysql_insert_id() function after adding the row to Table_One. Then use the value returned for the rest of the tables. http://dev.mysql.com/doc/refman/5.1/en/getting-unique-id.html Mike At 08:48 AM 3/12/2010, you wrote: I have two tables and I have

Re: Nested inserts possible?

2010-03-12 Thread Keith Clark
Johan, That seems to be the ticket. Thanks! Keith On Fri, 2010-03-12 at 16:54 +0100, Johan De Meersman wrote: Have a look at last_insert_id(). On Fri, Mar 12, 2010 at 3:48 PM, Keith Clark keithcl...@k-wbookworm.com wrote: I have two tables and I have data to insert into both at

RE: Nested inserts possible?

2010-03-12 Thread Gavin Towey
INTO child2 VALUES (@id, ... ); -Original Message- From: Keith Clark [mailto:keithcl...@k-wbookworm.com] Sent: Friday, March 12, 2010 7:57 AM To: mysql@lists.mysql.com Subject: Re: Nested inserts possible? Johan, That seems to be the ticket. Thanks! Keith On Fri, 2010-03-12 at 16:54

Re: Nested inserts possible?

2010-03-12 Thread Johan De Meersman
Have a look at last_insert_id()http://dev.mysql.com/doc/refman/5.1/en/information-functions.html#function_last-insert-id . On Fri, Mar 12, 2010 at 3:48 PM, Keith Clark keithcl...@k-wbookworm.comwrote: I have two tables and I have data to insert into both at the same time, but the second table