Re: quick newbie q: mysql_insert_id()

From: Date: Mon, 05 Jul 2004 18:47:16 +0000
Subject: Re: quick newbie q: mysql_insert_id()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-189743@lists.php.net to get a copy of this message
Christopher J. Mackie wrote:
If I want to use PEAR DB to handle my database connections, how do I retrieve the recordID (primary key) added when I run an INSERT query? mysql_insert_id($db_object) doesn't seem to work if the object is PEAR, and the PEAR docs don't seem to show the same function.
You probably need to use sequences, which are compatible across more databases and simulated in MySQL, I guess. Read here: http://pear.php.net/manual/en/package.database.db.db-common.nextid.php -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com

« previous php.general (#189743) next »