Re: Another Pear::DB question
| From: | Bob Bell | Date: | Fri, 19 Sep 2003 21:22:28 +0000 |
| Subject: | Re: Another Pear::DB question | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-7930@lists.php.net to get a copy of this message | ||
On Fri, Sep 19, 2003 at 10:32:32PM +0200, Lukas Smith <smith@backendmedia.com> wrote:
> > "Chuck Hagenbuch" <chuck@horde.org> schrieb im Newsbeitrag
> > news:1064001346.74c7e6edbe0e3@marina.horde.org...
> > > Quoting Jan Skopek <skopek@gmx.de>:
> > >
> > > > anyone knows how i can get the last-insert-id with Pear::DB?
> > > > I am using mysql-driver.
> > >
> > > Don't use an abstraction layer if you want to use MySQL-specific
> > features.
> > (In
> > > other words, you can't.)
> >
> > Thanx for the Tip, but i have to use one (project-standard).
> > Is there no other way in ::DB getting the last-insert-id ?
> > If not, then the only way i see is to do a "SELECT MAX(id) FROM
> table".
>
> SELECT last_insert_id()
But if you are going to be MySQL specific, why not just use the mysql
interface directly? I don't see the point if making a half-arsed
attempt at DBMS independence.
--
Bob Bell <bbell@users.sourceforge.net>