db mysql_insert_id() question

From: Date: Thu, 20 Jun 2002 15:34:42 +0000
Subject: db mysql_insert_id() question
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-1724@lists.php.net to get a copy of this message
I need to get the id of the last inserted record. Normally I would call mysql_insert_id(). But since I am moving everything to Pear it is my understanding that I need to use a call to nextid() to retrieve the next id PRIOR to insert. Is this my only option? Here is my concern. I am converting my entire app (which is live) to pear. But I have some applications that will still be using the mysql_insert_id() post insert. So, conceivably I could call nextid() method and get a record id of say 151 and then someone could insert under the non pear method and get a mysql_insert_id of 150 prior to my insert under pear. I would then get an error under pear when I go to do my insert because I would now have a dup key? Am I correct in my concern? David McInnis

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