RE: [PHP-DB] Re: autoincrement
To add to that, yes, the column must be numeric and it must also be your PRIMARY KEY column to be able to have the autoincrement attribute, not just a regular index. - J -Original Message- From: Glenn Holden [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 02, 2002 6:12 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Re: autoincrement First, I think an AUTO_INCREMENT column must be a numeric column, not TEXT. Second, be sure this column is indexed. If you have trouble, send us the results of a DESCRIBE TABLE `ajj47592`.`content`; statement. That may help us give you some specific syntax to try. Glenn "Daniel Broome" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Here is the info that I used,I think there is something elce that I have to > do but I have done everything to my know how.. > > Please help > > SQL-query : > > ALTER TABLE `ajj47592`.`content` CHANGE `code` `code` TEXT NOT NULL > AUTO_INCREMENT > > > MySQL said: > > > Incorrect column specifier for column 'code' > > > "Daniel Broome" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I am trying to add auto increment to a table I have already created in > > phpMyAdmin but I keeps coming up with an error. > > what can I do to fix this? > > > > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: autoincrement
First, I think an AUTO_INCREMENT column must be a numeric column, not TEXT. Second, be sure this column is indexed. If you have trouble, send us the results of a DESCRIBE TABLE `ajj47592`.`content`; statement. That may help us give you some specific syntax to try. Glenn "Daniel Broome" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Here is the info that I used,I think there is something elce that I have to > do but I have done everything to my know how.. > > Please help > > SQL-query : > > ALTER TABLE `ajj47592`.`content` CHANGE `code` `code` TEXT NOT NULL > AUTO_INCREMENT > > > MySQL said: > > > Incorrect column specifier for column 'code' > > > "Daniel Broome" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I am trying to add auto increment to a table I have already created in > > phpMyAdmin but I keeps coming up with an error. > > what can I do to fix this? > > > > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: autoincrement
Here is the info that I used, I know that there is something else that I have to add but I have done everything that I know... Please help... SQL-query : ALTER TABLE `ajj47592`.`content` CHANGE `code` `code` TEXT NOT NULL AUTO_INCREMENT MySQL said: Incorrect column specifier for column 'code' "Daniel Broome" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I am trying to add auto increment to a table I have already created in > phpMyAdmin but I keeps coming up with an error. > what can I do to fix this? > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: autoincrement
Here is the info that I used,I think there is something elce that I have to do but I have done everything to my know how.. Please help SQL-query : ALTER TABLE `ajj47592`.`content` CHANGE `code` `code` TEXT NOT NULL AUTO_INCREMENT MySQL said: Incorrect column specifier for column 'code' "Daniel Broome" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I am trying to add auto increment to a table I have already created in > phpMyAdmin but I keeps coming up with an error. > what can I do to fix this? > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: autoincrement
What's the error? Do you already have an auto-inc field? Have you tried it with another interface? Ie: directly in the MySQL command line util. Glenn Notes from MySQL.com: There can be only one AUTO_INCREMENT column per table, and it must be indexed. When you add an AUTO_INCREMENT column, column values are filled in with sequence numbers for you automatically. You can set the first sequence number by executing SET INSERT_ID=# before ALTER TABLE or using the AUTO_INCREMENT = # table option. See section 5.5.6 SET Syntax. With MyISAM tables, if you don't change the AUTO_INCREMENT column, the sequence number will not be affected. If you drop an AUTO_INCREMENT column and then add another AUTO_INCREMENT column, the numbers will start from 1 again. "Daniel Broome" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I am trying to add auto increment to a table I have already created in > phpMyAdmin but I keeps coming up with an error. > what can I do to fix this? > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php