RE: [PHP-DB] Re: Multi-Table Insert and gettin' data from auto-inc coloumn in one to the other

From: Date: Thu, 10 Oct 2002 12:31:15 +0000
Subject: RE: [PHP-DB] Re: Multi-Table Insert and gettin' data from auto-inc coloumn in one to the other
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-22314@lists.php.net to get a copy of this message
No, you have to use two queries to do two inserts into different tables... ---John Holmes... > -----Original Message----- > From: Noodle Snacks [mailto:webmaster@tececo.com] > Sent: Thursday, October 10, 2002 7:07 AM > To: php-db@lists.php.net > Subject: [PHP-DB] Re: Multi-Table Insert and gettin' data from auto-inc > coloumn in one to the other > > I can get the previous insert auto-increment id via mysql_insert_id(). it > will solve my problem. but if you know a soloution that will work in one > query please share it with me/everyone! > > > -- > JJ Harrison > lizner2002@yahoo.com.au > > "Noodle Snacks" <webmaster@tececo.com> wrote in message > news:20021010105833.4424.qmail@pb1.pair.com... > > I have table A with an auto increment coloumn called tid. during the > same > > query I need to get that value and stick it in a related record in > anouther > > table. > > > > I have two doubts. > > > > A: What is the way to do a multitable insert? guess is: INSERT INTO > > table(fields) VALUES (fields), table1(fields) VALUES (fields) etc... is > it > > even possible in one query? > > > > B: how can I get the auto increment value from one into the record on > the > > other table? > > > > > > -- > > JJ Harrison > > lizner2002@yahoo.com.au > > > > > > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.db (#22314) next »