YoY*_*oMa 3 mysql syntax-error
我想在这里制作一个像这样的mysql插件
<http://www.w3schools.com/php/php_mysql_insert.asp >
INSERT INTO table_name (column1, column2, column3,...) VALUES (value1, value2, value3,...)
Run Code Online (Sandbox Code Playgroud)
我试图将下面的值插入表userbase.
54007033331, Codi Y, Male, pub, http://google.com/ggg.jpg
INSERT INTO userbase (id,name,gender,publicity,pic) VALUES (54007033331, Codi Y, Male, pub, http://google.com/ggg.jpg)
MySQL query failed: 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 'Y, Male, pub, http://google.com/ggg.jpg)' at line 1
Run Code Online (Sandbox Code Playgroud)
任何人都可以指出我如何解决这种语法错误的正确方向?
小智 7
您应该在查询中正确引用字符串和char值.
INSERT INTO userbase (id,display,gender,publicity,pic)
VALUES (54007033331, 'Codi Y', 'Male', 'pub', 'http://google.com/ggg.jpg')
Run Code Online (Sandbox Code Playgroud)