Re: PEAR correspondent for mysql_insert_id()
| From: | Luc Saint-Elie | Date: | Thu, 20 Dec 2001 06:47:47 +0000 |
| Subject: | Re: PEAR correspondent for mysql_insert_id() | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-618@lists.php.net to get a copy of this message | ||
Hello,
In case someone has the same question, the answer is :
If $db is your current connection :
$lastAutoIncrement = mysql_insert_id($db->connection);
Hope this helps
Luc
At 22:04 19/12/01 +0100, Sebastian Bergmann wrote:
Luc Saint-Elie wrote: What is the PEAR equivalent of mysql_insert_id() to know the value of the last auto-increment field ? auto_increment is MySQL's way of implementing sequences. PEAR DB abstracts sequences using the nextID() method and uses low-level features, if available, of the underlying RDBMS.