Unknown column 'name' in 'field list ; please help me
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 2
回复讨论(解决方案) 错误提示有两个?
echo $sql; 贴出结果看看。
unknown column 'name' in 'field list ;
name 字段不存在,请检查
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 2
$sql=insert into shopsystem(name,tel,email,qq,addr,sex,brandname,commoditybrand,productid,ordername,shopname,shopaddr,invoicenumber,purchasingdate)
values('$name','$tel','$email','$qq','$addr','$sex','$brandname','$commoditybrand','$productid','$ordername','$shopname','$shopaddr','$invoicenumber','$purchasingdate');
if (!mysql_query($sql,$conn))
values 前加个空格试试。
字段错误 也有可能是 单引号问题,数字、日期等不加引号
shopsystem(name,tel,email,qq,addr,sex,brandname,commoditybrand,productid,ordername,shopname,shopaddr,invoicenumber,purchasingdate)这里面的字段全用`name`,`tel`,这样的试试,esc下面的那个键
单引号问题吧。。
建议用拼接
$sql=insert into shopsystem(name,tel,email,qq,addr,sex,brandname,commoditybrand,productid,ordername,shopname,shopaddr,invoicenumber,purchasingdate)values('.$name.','.$tel.',' ....
其它类似信息