Re: PEAR DB Return Serial
| From: | Martin Jansen | Date: | Sun, 23 Mar 2003 11:40:33 +0000 |
| Subject: | Re: PEAR DB Return Serial | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-4382@lists.php.net to get a copy of this message | ||
Am Son, 2003-03-23 um 04.15 schrieb James Taylor:
> Hi everyone, I'm writing a script that inserts data into a postgres
> table. The ID column is the primary key, and is just a serial that auto
> increments on every insert. I need to know how to get PEAR to return
> the value of the inserted ID.
You can't use auto_increment fields with PEAR::DB as they are not
portable. Instead you have to use sequences:
http://pear.php.net/manual/en/core.db.nextid.php
- Martin