SQL statement Error

Source: Internet
Author: User
Mysql

$query = "SELECT * from a where ' z ' = ' $url [query] ' limit 0,10 '; so write it Wrong Warning:mysql_fetch_array (): supplied argument is not A valid MySQL result resource in$query= "SELECT * from a where ' z ' = ' $url [query] '; but that's OK, why?


Reply to discussion (solution)

$query = "SELECT * from a where ' z ' = '". $url [' query ']. "' Limit 0,10 ';

Echo Mysql_error (); Look

I am also a rookie, but watching the PHP video of the Wisdom podcast learned this method of troubleshooting, first $query print (echo) out, and then put the results of this print into the MySQL black window to see if it can get results. If not, look at the error message, the appropriate modification.
See your error message, is the result set $res=mysql_query ($sql, $conn) did not obtain successfully.

Judging to see if there is a value

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