What's wrong with this SQL thread?

Source: Internet
Author: User
$NQL = "INSERT into ' dh_xxx ' (' email ', ' tel ', ' upass ', ' Unick ', ' sri ', ' sex ', ' photo ', ' add ', ' Sgao ', ' xli ', ' xlit ', ' ysru ', ' Ysrid ', ' Sxiao ', ' Xzuo ', ' Zwjsao ', ' Hyzkuang ', ' Addip ', ' addipt ', ' McK ') VALUES (' ". $email. "', '". $tel. "', '". Mysql_real_escape_string ($upass). "', '". Mysql_real_escape_string ($unick). "', '". $sri. "', '". $sex. "', '". $photo. "', '". $add. "',". $sgao. ",". $xli. ", '". $xlit. "',". Yxin. ", '". Yxint. "', '". $sxiao. "', '". $xzuo. "', '". Mysql_real_escape_string ($zwjsao). "', '". $hyzkuang. "', '". Getipaddress (). "', '". getIPS138 (Getipaddress ()). "',". $site ["Examine"]. ")";

Look for an expert


Reply to discussion (solution)

mysql_query ($NQL) or Die (Mysql_error ()); Just do it, you know.

...,". Yxin. ", '". Yxint. " ...

What is it?
If it's a constant, what's the value?

mysql_query ($NQL) or Die (Mysql_error ()); Just do it, you know.



Prompt for such error: You have a error in your SQL syntax; Check the manual, corresponds to your MySQL server version for the right syntax to use near ') ' on line 1

What's the matter ah, I php small white, seek guidance

...,". Yxin. ", '". Yxint. " ...

What is it?
If it's a constant, what's the value?



These are variables and all have values with single quotes that are non-numeric types that do not have a numeric type variable

Is the variable why not $???

Is the variable why not $???



It was leaking, I added it now, or reported the mistake:

You have a error in your SQL syntax; Check the manual, corresponds to your MySQL server version for the right syntax to use near ') ' on line 1

where Getipaddress () getIPS138 () is a function
$site ["Examine"] $site is a globally defined variable

After I have inserted these three variables and deleted them, is it normal to call the function and the global variable directly in the string?

As long as the character type field, you should enclose the value outside the quotation marks.
Echo $NQL; Look what it is.

  • 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.