Re: Three queries. One Form.

From: Date: Thu, 09 Jun 2005 23:35:23 +0000
Subject: Re: Three queries. One Form.
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-216778@lists.php.net to get a copy of this message
On 6/9/05, Matt Babineau <matt@criticalcode.com> wrote: > Well after the first query you could do this: > > $art_id = mysql_insert_id(); > > There is your new unique art_id you just created. > > Do this for the next table, the do the insert on your 3rd table. Thanks, Matt! > > > Matt Babineau > Criticalcode > w: http://www.criticalcode.com > p: 858.733.0160 > e: matt@criticalcode.com > > -----Original Message----- > From: jack jackson [mailto:jackson.linux@gmail.com] > Sent: Thursday, June 09, 2005 4:06 PM > To: php-general@lists.php.net > Subject: [PHP] Three queries. One Form. > > Hi, > I am trying to make one form on a single page insert info into three tables; > query 1 creates an art_id (auto-increment) for the newly created row in > table art; > > query2 creates a media_id in table media. > > Then I need to get the art_id and media_id created by the first two queries > to insert into an intersection table as query three. > > Must I run an intermediate query to get the ids, and assign it to vars? What > would it even look like? > > Thanks in advance, > > -- > PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: > http://www.php.net/unsub.php > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#216778) next »