Request for lastID
| From: | Colin Viebrock | Date: | Thu, 29 Mar 2001 00:28:13 +0000 |
| Subject: | Request for lastID | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-127@lists.php.net to get a copy of this message | ||
I would *really* like to suggest the following addition to DB::mysql.php, or
something like it:
function lastID() {
if ($this->options['optimize'] == 'portability') {
return DB_ERROR_UNSUPPORTED;
}
return mysql_insert_id($this->connection);
}
mysql_insert_id() is a very highly used PHP function. If we hope to convert
people to using PEAR's DB, then keeping at least a non-portable version of
this will save people a *lot* of recoding.
Maybe this functionality can be emulated in the other DBs? I don't know if
auto_increment fields are specific to MySQL.
--
Colin Viebrock
Co-Founder, easyDNS Technologies Inc.
http://www.easyDNS.com/