RE: [PHP] auto_increment
| From: | Scott Hurring | Date: | Tue, 28 May 2002 20:15:30 +0000 |
| Subject: | RE: [PHP] auto_increment | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-99551@lists.php.net to get a copy of this message | ||
Look at Sequences for Postgres.
---
Scott Hurring
Systems Programmer
EAC Corporation
ScottH@eac.com
Voice: 201-462-2149
Fax: 201-288-1515
> -----Original Message-----
> From: webmaster [mailto:webmaster@harbornet.com]
> Sent: Tuesday, May 28, 2002 7:12 AM
> To: php-general@lists.php.net
> Subject: [PHP] auto_increment
>
>
> I think this is any easy question, but I couldn't find an
> answer in the
> php Black Book for PostgreSQL. Does anyone know the equivilant of
> auto_increment for PostgreSQL? This is the php code that I have:
>
> $query = "CREATE table $tablename (id INT NOT NULL PRIMARY
> KEY, ip TEXT,
> customer TEXT, dslphone TEXT, date TEXT, vpivci TEXT)";
>
> This creates the table, but when I need to add data to the Database, I
> have to specify a unique id each time. I need want the id to
> automatically increment each time data is added the the DataBase. Is
> there a way to do this by adding an auto_increment option to the id
> field when the table is first created?
>
> Thanks for any Help,
> -Elkan
>
> PHP version: 4.0.6
> OS: RH 7.2
> PostgreSQL: v.7.1
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>