auto_increment
| From: | webmaster | Date: | Tue, 28 May 2002 11:11:34 +0000 |
| Subject: | auto_increment | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-99540@lists.php.net to get a copy of this message | ||
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