RE: [PHP] auto-increment not working?? MySQL
| From: | Jay Blanchard | Date: | Mon, 12 Jul 2004 20:36:20 +0000 |
| Subject: | RE: [PHP] auto-increment not working?? MySQL | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-190291@lists.php.net to get a copy of this message | ||
[snip]
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??
[/snip]
The guys on the MySQL list do. Have you read this-->
http://dev.mysql.com/doc/mysql/en/example-AUTO_INCREMENT.html