I created this using MySQL WorkBench
CREATE TABLE IF NOT EXISTS `bakasura_new`.`cities` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT ,
`name` VARCHAR(255) NOT NULL COMMENT 'City Name' ,
`short_name` VARCHAR(255) NOT NULL COMMENT 'Short Name' ,
`country_id` INT(11) UNSIGNED NOT NULL ,
PRIMARY KEY (`id`) ,
INDEX `fk_cities_countries` (`country_id` ASC) ,
ENGINE = InnoDB;
I am getting this error
MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '= InnoDB' at line 8
You have a dangling comma here:
INDEX `fk_cities_countries` (`country_id` ASC) ,
And you also have a missing parenthesis at the end:
CREATE TABLE IF NOT EXISTS `bakasura_new`.`cities` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT ,
`name` VARCHAR(255) NOT NULL COMMENT 'City Name' ,
`short_name` VARCHAR(255) NOT NULL COMMENT 'Short Name' ,
`country_id` INT(11) UNSIGNED NOT NULL ,
PRIMARY KEY (`id`) ,
INDEX `fk_cities_countries` (`country_id` ASC)
) ENGINE = InnoDB;
There is a ) missing at the end of the last )
INDEX `fk_cities_countries` (`country_id` ASC) )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With