Re: auto-increment not working?? MySQL
| From: | Justin Patrin | Date: | Mon, 12 Jul 2004 21:06:16 +0000 |
| Subject: | Re: auto-increment not working?? MySQL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-190294@lists.php.net to get a copy of this message | ||
Your primary key should be only (
id).
On Mon, 12 Jul 2004 13:04:19 -0700, barophobia <barophobia@gmail.com> wrote:
> hello.
>
> i've got a strange problem with a MySQL table. although my 'id' column
> is set to 'auto_increment', each new record i insert has the value 1.
> (instead of 1, 2, 3, etc.)
>
> i checked my sql statement and i'm not assigning the id value by
> mistake. here is my create statement (showing only a few columns from
> the table for brevity):
>
> CREATE TABLE customers (
> id int(10) unsigned NOT NULL auto_increment,
> fname varchar(20) NOT NULL default '',
> lname varchar(20) NOT NULL default '',
> is_active tinyint(4) NOT NULL default '0',
> PRIMARY KEY
> (fname,lname,email,id),
> UNIQUE KEY email (email)
> ) TYPE=MyISAM;
>
> anyone know what's going on??
>
> chris.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> !DSPAM:40f2f0f6322131004619089!
>
>
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--