From: Johan De Meersman Date: March 12 2010 3:54pm Subject: Re: Nested inserts possible? List-Archive: http://lists.mysql.com/mysql/220944 Message-Id: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=0050450160727da2eb04819c8ab5 --0050450160727da2eb04819c8ab5 Content-Type: text/plain; charset=ISO-8859-1 Have a look at last_insert_id() . On Fri, Mar 12, 2010 at 3:48 PM, Keith Clark wrote: > I have two tables and I have data to insert into both at the same time, > but the second table depends on an ID that is auto created in the first > table. I'm not sure exactly how to accomplish this. > > Table_One > > Table_One_Index_ID > Data_One > Date_Two > > Table_Two > > Table_Two_Index_ID > Table_One_Index_ID > Data_Three > Data_Four > > > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql?unsub=vegivamp@stripped > > -- Bier met grenadyn Is als mosterd by den wyn Sy die't drinkt, is eene kwezel Hy die't drinkt, is ras een ezel --0050450160727da2eb04819c8ab5--