equivalent to mysql_insert_id()
| From: | Vern T Takebayashi | Date: | Wed, 30 Jun 2004 19:57:10 +0000 |
| Subject: | equivalent to mysql_insert_id() | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-13425@lists.php.net to get a copy of this message | ||
Hi,
Please excuse my ignorance as I just started looking at PEAR DB this past
weekend. I have some PHP scripts that use the mysql_insert_id() function
to return the last ID generated using auto_increment. In PEAR, is using
the nextID() function and subtracting one, roughly equivalent to using the
mysql_insert_id() function?
I suppose that changing the code to use sequences might be better, but I
was thinking that the short-term solution would be using the nextID()
function in the manner described above.
Any suggestions would be appreciated.
Thanks,
Vern
Vern Takebayashi vern@hcc.hawaii.edu
Honolulu Community College
ICS/Engineering