php - 无法创建 mySQL 表

标签 php mysql

这里我要创建基本的 mysql 表,但是遇到了问题。

Error is : #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 'IDENTITY PRIMARY KEY NOT NULL, NAME varchar(100) )' at line 3

CREATE TABLE `AB_CATEGORY`
(
ID integer IDENTITY PRIMARY KEY NOT NULL,
NAME varchar(100)
);

最佳答案

只需删除 IDENTITY 关键字即可 -

CREATE TABLE `AB_CATEGORY`
(
   ID integer PRIMARY KEY NOT NULL,
   NAME varchar(100)
);

关于php - 无法创建 mySQL 表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22049030/

相关文章:

php - 从两个表中选择不匹配的记录

php - 如何显示用户配置文件中的 acf 字段?

php - 除最后一行外的中心 float

MySQL:如果其中一个返回 NULL,则 INNER JOIN 会使 2 个 LEFT JOIN 崩溃

mysql - SQL 错误 : #1005 - Can't create table

PHP:如何确定数据库连接是否打开

MySQL 存储函数

php shell_exec() 命令不工作

php - 同一台PC上的stream_socket_server和stream_socket_client之间的长时间延迟

php - 将特定字段收集到数组中