Re: the Pear::DB way to do mysql_insert_id?
| From: | electroteque | Date: | Thu, 02 Jan 2003 21:58:46 +0000 |
| Subject: | Re: the Pear::DB way to do mysql_insert_id? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-3154@lists.php.net to get a copy of this message | ||
i added this function to mysql.php
function lastinsertId()
{
$result = @mysql_insert_id($this->connection);
return $result;
}
i have no need for sequences i use auto inc rows
i also posted this before but noone seems to care to add it
"Jeff Bearer" <jbearer@pittsburghlive.com> wrote in message
news:1038841574.5665.9.camel@jbearer.tribweb.com...
> What is the proper PEAR way to get the value that mysql_insert_id()
> gives you when using an auto_increment index.
>
> I'm assuming that the function isn't implemented that way because other
> databases don't do sequences the same way. I looked through the
> nextId() function and it uses another table to keep the sequence.
>
> Could somebody explain the way this should be implemented with mysql?
>
> --
> Jeff Bearer, RHCE
> Webmaster, PittsburghLIVE.com
> Winner 2002 Eppy Award, Best U.S. Newspaper Website
>