您好我想創建在MySQL使用SQL表,但我不斷收到error.Here是我的代碼:創建表時會引發錯誤
USE e-commerce
CREATE TABLE `categories` (
`id` SMALLINT NOT NULL AUTO_INCREMENT,
`category` VARCHAR(30) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `category` (`category`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
當我試圖在phpMyAdmin SQL控制檯運行此得到這個錯誤:
#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 'CREATE TABLE `categories` (`id` SMALLINT NOT NULL AUTO_INCREMENT, `category` ' at line 2
我在做什麼錯?
@MahmoudGamal:感謝花花公子。 –