SQL query:
CREATE TABLE `animals`.`ads_DB` (
`id` DOUBLE( 25 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`category` VARCHAR( 255 ) NOT NULL ,
`subcategory` VARCHAR( 255 ) NOT NULL ,
`title` VARCHAR( 255 ) NOT NULL ,
`description` TEXT NOT NULL ,
`email` VARCHAR( 255 ) NOT NULL ,
`username` VARCHAR( 255 ) NOT NULL ,
`mobile_no` DOUBLE( 25 ) NOT NULL ,
`phone_no` DOUBLE( 25 ) NOT NULL ,
`address` VARCHAR( 255 ) NOT NULL ,
`city` VARCHAR( 60 ) NOT NULL ,
`state` VARCHAR( 60 ) NOT NULL ,
`country` VARCHAR( 60 ) NOT NULL ,
`photo` VARCHAR( 255 ) NOT NULL ,
`link` VARCHAR( 255 ) NOT NULL
) ENGINE = INNODB;
MySQL said:
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 ‘) NOT NULL AUTO_INCREMENT PRIMARY KEY, category VARCHAR(255) NOT NULL, `subcat’ at line 1
You have not specified precision correctly for all your
DOUBLEfields. The query should be something like:Notice how I’ve changed the
DOUBLE(...)– you have to specify how many total digits you want and how many after the decimal point. Read this for more information.Why are you using doubles anyway? Seems very odd for the values that you need to store.