qq_40877152 2020-04-05 15:45 采纳率: 0%
浏览 193

Mysql一直报错,找不到问题,希望大神能够帮帮我。

Error: 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 ''user' WHERE username='q' and password='123'' at line 1

代码如下

DROP TABLE IF EXISTS user;
CREATE TABLE user (
id int(10) NOT NULL AUTO_INCREMENT,
username varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
password varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


-- Records of user


INSERT INTO user VALUES ('11', 'q', '123');
INSERT INTO user VALUES ('10', '', '');



  • 写回答

2条回答 默认 最新

  • silence cc 2020-04-05 16:37
    关注

    截图你的sql执行语句及报错信息,好像''没闭合

    评论

报告相同问题?