Look at Sequences for Postgres.

---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-288-1515

> -----Original Message-----
> From: webmaster [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 28, 2002 7:12 AM
> To: [EMAIL PROTECTED]
> 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
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to