[PHP] quick newbie q: mysql_insert_id()

2004-07-05 Thread Christopher J. Mackie
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.

Tx,  --CJ

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] quick newbie q: mysql_insert_id()

2004-07-05 Thread John W. Holmes
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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php