Creating a table

rcadmin 29 Aug, 2010
I get the following error when creating a table

Error while creating table :Incorrect column specifier for column 'cf_id' SQL=CREATE TABLE `jos_chronoforms_form_Year9To10_options` (`cf_id` VARCHAR(255) NOT NULL auto_increment, `uid` VARCHAR(255) NOT NULL, `recordtime` VARCHAR(255) NOT NULL, `ipaddress` VARCHAR(255) NOT NULL, `cf_user_id` VARCHAR(255) NOT NULL, `Name` VARCHAR(255) NOT NULL, `Username` VARCHAR(255) NOT NULL, `SchoolEmail` VARCHAR(255) NOT NULL, `Art` VARCHAR(255) NOT NULL, `BusinessStudies` VARCHAR(255) NOT NULL, `Drama` VARCHAR(255) NOT NULL, `ESOL` VARCHAR(255) NOT NULL, `FoodTechnology` VARCHAR(255) NOT NULL, `French` VARCHAR(255) NOT NULL, `Graphics` VARCHAR(255) NOT NULL, `Japanese` VARCHAR(255) NOT NULL, `Maori` VARCHAR(255) NOT NULL, `Music` VARCHAR(255) NOT NULL, `SportsScience` VARCHAR(255) NOT NULL, `Technology` VARCHAR(255) NOT NULL, PRIMARY KEY (`cf_id`)) ENGINE = MYISAM ;



But its what I usually do and it works, so I'm a little confused 🤨
nml375 29 Aug, 2010
Hi,
You've set cf_id as a VARCHAR, which does not work well with the 'auto_increment' function.
What you need to do, is set it to an INT instead.

/Fredrik
rcadmin 29 Aug, 2010
Thanks... yes that makes sense.... in the past I haven't changes the default values of the first number of fields so I didn't think they would be a problem... Will check next time.

Thanks
This topic is locked and no more replies can be posted.