Unknowncolumn & # x27; name & # x27; in & # x27; fieldlist; pleasehelpme !! This post was last edited by neuuuuuuu from 2014-12-9:9:20:25 & lt ;? Php & nbsp; $ conn & nbsp; mysql_co Unknown column 'name' in 'Field list; please help me !!
This post was last edited by neuuuuuuu at 19:20:25
$conn = mysql_connect("localhost", "root", "");
/*
echo"$stm"
*/
if (!$conn)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("root",$conn)or die(mysql_error());
mysql_query('set names GB2312');
$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))
{
die ('Error: ' . mysql_error());
}
mysql_close($conn);
?>
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
------ Solution ----------------------
Are there two error messages?
Echo $ SQL; paste the results to see.
------ Solution ----------------------
Unknown column 'name' in 'Field list;
The name field does not exist. Please check
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 ))
Add a space before values.