Unknowncolumn 'name' in 'fieldlist; pleasehelpme! Solution

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.