i get this error when i try to inport to data base
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 '('id')
) TYPE=MyISAM AUTO_INCREMENT=6' at line 4
DROP TABLE IF EXISTS `categories`;
CREATE TABLE `categories` (
`id` int(5) NOT NULL auto_increment,
`category` varchar(50) NOT NULL default '',
PRIMARY KEY ('id')
) TYPE=MyISAM AUTO_INCREMENT=6 ;
解决方案
You are using ' here
PRIMARY KEY ('id')
id is in this case a string, not the column name. Use backticks instead.
PRIMARY KEY (`id`)