A very simple insert about the problem, but there is a problem, please help to see exactly where the problem

Source: Internet
Author: User
A simple insert problem, but there is a problem, please help to see where there is a problem
INSERT INTO RC (ZJBS,ZJDM,GZBJ,XINGMING,SEX,MINZU,ZZMM,CSRI,CSD,BYYX,BYSJ,SXZY,WHCD,XW,GZDW,GZSJ,DWLB,DWXZ,XZZW, XZJB,CSZY,GKHY,JSZC,ZGZT,TEL,ZIP,YS,GGQJB,TTNF,TTJE,TGNF,SBNF,BDNF,JBZN,HGNF,CHCL,LHJT,GZJL,TCSJ,DBLZ,ZXCG, Isvalid,pic) VALUES (' Dsaf ', ' asdf ', ' sdfasd ', ' asdf ', ' 1 ', ' hui ', ' asdf ', ' asdf ', ' asdf ', ' asdf ', ' asdf ', ' FASD ' F ', ' High school ', ' ASF ', ' asdf ', ' asfd ', ' asdf ', ' asdf ', ' asd ', ' asdf ', ' asdf ', ' ffasdf ', ' Advanced ', ' asdf ', ' asdf ', ' ASD F ', ' asdf ', ' asfd ', asdf,asdf,tgnf,sbnf,asdf,asdf,asdf, ' asdf ', ' asdf ', ' asdf ', ' asdf ', ' asdf ', ' asdf ', ' 0 ', ' 118 6039175.gif ')

Print it out like this

$SQL = "INSERT INTO RC (";
$SQL = $SQL. "Zjbs,zjdm,gzbj,xingming,sex,minzu,zzmm,csri,csd,byyx,bysj,sxzy,whcd,xw,gzdw,gzsj,dwlb,dwxz,xzzw,xzjb,cszy, Gkhy,jszc,zgzt,tel,zip,ys,ggqjb,ttnf,ttje,tgnf,sbnf,bdnf,jbzn,hgnf,chcl,lhjt,gzjl,tcsj,dblz,zxcg,isvalid,pic ";
$SQL = $SQL. ") VALUES (";
$SQL = $SQL. "' $zjbs ', ' $zjdm ', ' $gzbj ', ' $xingming ', ' $sex ', ' $minzu ', ' $zzmm ', ' $csri ', ' $CSD ', ' $byyx ', ' $bysj ', ' $sxzy ' ', ' $whcd ', ' $xw ', ' $gzdw ', ' $gzsj ', ' $dwlb ', ' $dwxz ', ' $xzzw ', ' $xzjb ', ' $cszy ', ' $gkhy ', ' $jszc ', ' $zgzt ', ' $tel ', ' $zip ', ' $ys ', ' $ggqjb ', $TTNF, $ttje, TGNF,SBNF, $BDNF, $JBZN, $HGNF, ' $chcl ', ' $lhjt ', ' $gzjl ', ' $tcsj ', ' $dblz ' ', ' $ZXCG ', ' 0 ', ' $pic ';
$SQL = $SQL. ") ";

This is my combination.


The printed SQL in the MySQL visual interface can be inserted directly into the database without any exception
But if you do it with PHP, you're not going to succeed.

Everybody help me see why

Thank you first.

Online, etc.

------Solution--------------------
1. Did you have an error? What's wrong?
2, it is best to put you into this code to paste up
------Solution--------------------
Echo Mysql_error ();
Let's see what's wrong.
------Solution--------------------
$SQL = "INSERT INTO RC (";
$SQL = $SQL. "Zjbs,zjdm,gzbj,xingming,sex,minzu,zzmm,csri,csd,byyx,bysj,sxzy,whcd,xw,gzdw,gzsj,dwlb,dwxz,xzzw,xzjb,cszy, Gkhy,jszc,zgzt,tel,zip,ys,ggqjb,ttnf,ttje,tgnf,sbnf,bdnf,jbzn,hgnf,chcl,lhjt,gzjl,tcsj,dblz,zxcg,isvalid,pic ";
$SQL = $SQL. ") VALUES (";
$SQL = $SQL. "' $zjbs ', ' $zjdm ', ' $gzbj ', ' $xingming ', ' $sex ', ' $minzu ', ' $zzmm ', ' $csri ', ' $CSD ', ' $byyx ', ' $bysj ', ' $sxzy ' ', ' $whcd ', ' $xw ', ' $gzdw ', ' $gzsj ', ' $dwlb ', ' $dwxz ', ' $xzzw ', ' $xzjb ', ' $cszy ', ' $gkhy ', ' $jszc ', ' $zgzt ', ' $tel ', ' $zip ', ' $ys ', ' $ggqjb ', ' $ttnf ', ' $ttje ', ' tgnf ', ' sbnf ', ' $bdnf ', ' $jbzn ', ' $hgnf ', ' $chcl ', ' $LHJT ' , ' $gzjl ', ' $tcsj ', ' $dblz ', ' $zxcg ', ' 0 ', ' $pic ' ";
$SQL = $SQL. ") ";
------Solution--------------------
Gkhy ', ' $jszc ', ' $zgzt ', ' $tel ', ' $zip ', ' $ys ', ' $ggqjb ', $TTNF, $ttje, TGNF,SBNF, $BDNF, $JBZN, $HGNF,
The TGNF,SBNF variable in this line does not have a $ and no quotes!
  • 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.