create table foo (
   id     int not null auto_increment primary key,
   state  enum('enabled', 'disabled')
create table foo (
   id     int not null primary key default nextval('foo_id_seq'),
   state  varchar(8) check (state in ('enabled', 'disabled'))
create sequence foo_id_seq;
select setval('foo_id_seq', (select max(id) from foo));

-- Kind regards,Yuri.
>>>> <<<< Quality web hosting

"Webmaster" <[EMAIL PROTECTED]>

> I'm using PHP v.4.0.6. and PostgreSQL 7.2.  Does any one know the
> equivilant of auto_increment for postgresSQL?  For example when creating
> a table:
> $query = "CREATE table $tablename (id INT UNSIGNED NOT NULL
> AUTO_INCREMENT PRIMARY KEY, firstname TEXT, lastname TEXT, emailaddress
> TEXT, )";
> this works fine in MySQL, but I keep getting errors with PostgreSQL.
> thanks for any help,
> -Elkan

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to