ERROR 1064 (42000): 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 'UNSIG
NED int,
Primary key(id),
Index(CaId), foreign key(CaId) references Categ' at line 6
Query OK, 0 rows affected, 1 warning (0.00 sec)
原因:
1。在定义字段时,有和MYSQL的保留字段有相同的。
2。在写定义时, 写成了NewsId UNSIGNED int , 应该是NewsId int UNSIGNED.
整型的每一种都有无符号(unsigned)和有符号(signed)两种类型(float和double总是带符号的),在默认情况下声明的整型变量都是有符号的类型(char有点特别),如果需声明无符号类型的话就需要在类型前加上unsigned