Re: auto-increment not working?? MySQL
| From: | Curt Zirzow | Date: | Tue, 13 Jul 2004 06:19:37 +0000 |
| Subject: | Re: auto-increment not working?? MySQL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-190316@lists.php.net to get a copy of this message | ||
* Thus wrote Jay Blanchard:
> [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œWc=9œë
> Þ‘àô“ n,lname,email,NPyŽ"i"C
> ŽY‹Á{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
more like 'db 101' and 'Intro to Mailing lists', would be a more
appropriate thing to do.
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!