Php 错误#1064-您的SQL语法有错误
无法找出我的SQL语句的错误所在完整错误消息为Php 错误#1064-您的SQL语法有错误,php,mysql,sql,xampp,Php,Mysql,Sql,Xampp,无法找出我的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
#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
希望这有帮助。我注意到密码字段上的varchar没有长度。谢谢@Andrew对SQL非常陌生,它工作了