gpt4 book ai didi

php - 错误 #1064 - 您的 SQL 语法有错误

转载 作者:行者123 更新时间:2023-11-29 11:55:09 26 4
gpt4 key购买 nike

无法弄清楚我的 SQL 语句有什么问题,完整的错误消息是

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'NOT NULL , 
`Sex` BOOLEAN NOT NULL ,
PRIMARY KEY(userID)
)' at line 7

实际代码是

CREATE TABLE `car_rental`.`users` ( 
`userID` int(9) AUTO_INCREMENT NOT NULL ,
`First Name` VARCHAR(25) NOT NULL ,
`Last Name` VARCHAR(55) NOT NULL ,
`E-mail Address` VARCHAR(55) NOT NULL ,
`Age` INT NOT NULL ,
`Password` VARCHAR NOT NULL ,
`Sex` BOOLEAN NOT NULL ,
PRIMARY KEY(userID)
)
ENGINE = InnoDB;

最佳答案

错误主要是因为:

`Password` VARCHAR NOT NULL

将其更改为:

`Password` VARCHAR(60) NOT NULL

希望这有帮助。

关于php - 错误 #1064 - 您的 SQL 语法有错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33327563/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com