crud application please help

Lists: Postg범퍼카 토토SQL : Postg범퍼카 토토SQL 메일 링리스트 : 2011-05-16 이후 PGSQL-PHP 02:19
From: hatem gamal elzanaty <hatem(at)softpro(dot)bz>
To: pgsql-php(at)postgresql(dot)org
Subject: crud application please help
Date: 2011-05-16 02:19:27
Message-ID: 4DD089AF.50104@softpro.bz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: Postg범퍼카 토토SQL : Postg범퍼카 토토SQL 메일 링리스트 : 2011-05-16 이후 PGSQL-PHP 02:19

hi,
can you please guide me in a crud application for one table that have
auto increment serial number for each record can you please give what
syntax do i have to enter new record without writing manually the id of
the record through php connection to postgresql if you can send me an
example for one table with two fields it would be more than enough i
would appreciate if you gave me a link , book name , tutorial web site
,........ etc
thanks in advance

hatem gamal
201515604034
hatem(at)softpro(dot)bz


From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: hatem gamal elzanaty <hatem(at)softpro(dot)bz>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: crud application please help
Date: 2011-05-16 07:13:38
Message-ID: 4DD0CEA2.5020001@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: Postg스포츠 토토SQL : Postg스포츠 토토SQL 메일 링리스트 : 2011-05-16 이후 PGSQL-PHP

On 16/05/2011 03:19, hatem gamal elzanaty wrote:
> hi,
> can you please guide me in a crud application for one table that have
> auto increment serial number for each record can you please give what
> syntax do i have to enter new record without writing manually the id of
> the record through php connection to postgresql if you can send me an
> example for one table with two fields it would be more than enough i
> would appreciate if you gave me a link , book name , tutorial web site

Auto-incrementing columns, or SERIAL types [1]:

http://www.postgresql.org/docs/9.0/static/datatype-numeric.html#DATATYPE-SERIAL

Default values - look for the DEFAULT keyword:

http://www.postgresql.org/docs/9.0/static/sql-createtable.html

[1] Note that SERIAL isn't a real type, but just syntactic sugar that
creates a sequence and sets the column to pull from the sequence by
default. More on sequences:

http://www.postgresql.org/docs/9.0/static/sql-createsequence.html

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie