Re: mysql_insert_id

From: Date: Wed, 21 Jul 2004 15:01:15 +0000
Subject: Re: mysql_insert_id
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-13792@lists.php.net to get a copy of this message
How's that? AFAIK it always works when the INSERT worked. And it should always work the same as LAST_INSERT_ID() On Wed, 21 Jul 2004 14:17:15 +0200, Pietro Cottafavi <pietro.cottafavi@fastwebnet.it> wrote: > yes but this one don't works always > > > > Sonke Ruempler wrote: > > >Pietro Cottafavi wrote: > > > > > >>i have found the solution in the archive , next time i'll first search > >>in the archive ;) > >>in the docs there is nothing about this. > >> > >>BTW the better solution seems to be > >>$insertid = $db->getOne('SELECT LAST_INSERT_ID()'); > >> > >> > > > >Or: > > > >$id = mysql_insert_id($db->connection); > > > > > > > > -- > PEAR General Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > !DSPAM:40fe5ca1181954259783994! > > -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin--

« previous php.pear.general (#13792) next »