RE: [PHP-WIN] Getting the auto increment value of the row inserte d ??

From: Date: Mon, 08 Jan 2001 19:25:56 +0000
Subject: RE: [PHP-WIN] Getting the auto increment value of the row inserte d ??
Groups: php.windows 
Request: Send a blank email to php-windows+get-4874@lists.php.net to get a copy of this message
Sounds VERY similar to a problem I was dealing with. One of the suggestions that was posed to me was a cross table which held only a list of keys... less chance of getting the wrong key. --------------------- John Asendorf - jasendorf@lcounty.com Web Applications Developer http://www.lcounty.com - NEW FEATURES ADDED DAILY! Licking County, Ohio, USA 740-349-3631 The benefit to the government of replacing all $1 Federal Reserve notes with $1 coins would be $522.2 million per year, according to estimates of the General Accouting Office released on April 7, 2000. > -----Original Message----- > From: Mujahid [mailto:mwazir@vsnl.com] > Sent: Monday, January 08, 2001 2:22 PM > To: php-windows@lists.php.net > Subject: [PHP-WIN] Getting the auto increment value of the > row inserted > ?? > > > Hi > > I am using PHP4 and mySQL. > I have a table in mySQL with an auto increment column as the > primary key. > When I do an insert from the PHP page, I need to return the inserted > record's primary key. > Currently after inserting the record I am immediatly doing a > "select max(pk) > from tablename" to fetch the value. > Is there any better solution for this. > > Many thanks > -Mujahid > > > > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net >

« previous php.windows (#4874) next »