Re: nextID
| From: | Colin Viebrock | Date: | Tue, 10 Jul 2001 17:03:11 +0000 |
| Subject: | Re: nextID | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-188@lists.php.net to get a copy of this message | ||
"Jeff Stuart" <jstuart-devel@neo.rr.com> wrote in message
news:20010708232144.92538.qmail@pb1.pair.com...
> Ok... question... I know that Sebastian (I think it was you. :D) said that
> Pear won't support mysql's auto increment feature. Does this mean that
Pear
> won't work with a table that has an auto increment feature? Or that you
> won't use it to generate the sequences? Assuming the latter, can I use
> mysql_insert_id with Pear::DB to get the last inserted id? Also, can we
use
> some of the other mysql functions with Pear::DB? IE is there a way for us
> to get access to Pear::DB's internal variable that holds the resource link
> id?
Assuming $DB is your instance of PEAR::DB, you can use:
$id = mysql_insert_id($DB->connection);
- Colin