php 连接 mysql 的插入语句报错
mysql_query("INSERTINTOstudent_card(name,number,phone,qq,email)VALUES('$_POST[name]',...
mysql_query("INSERT INTO student_card (name,number,phone,qq,email) VALUES ('$_POST[name]','$_POST[number]','$_POST[phone]','$_POST[qq]','$_POST[email]'") or die(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 '' at line 1
这是报错语句
insert into student_card (name,number,phone,qq,email) values ("中文",2,4,4,5);
这是手动输入,成功. 展开
这是原语句
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 '' at line 1
这是报错语句
insert into student_card (name,number,phone,qq,email) values ("中文",2,4,4,5);
这是手动输入,成功. 展开
1个回答
展开全部
最后面少了一个)括号
mysql_query("INSERT INTO student_card (name,number,phone,qq,email) VALUES ('$_POST[name]','$_POST[number]','$_POST[phone]','$_POST[qq]','$_POST[email]')") or die(mysql_error());
追问
已经哭瞎了,,,,,果然复制粘贴不可靠 以后都要手打 血的教训啊
谢拉兄弟
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询