Data query problems

Source: Internet
Author: User
Require_once './config/conn.php '; $asin = ' 6007-00a '; $sql = "Select T. ' Item_code ', T. ' Package_area ', T. ' Asin ', T. ' SKU ', b  . ' Pack_weight ' from ' 1_sku_comparison ' t left joins ' 1_product ' B on t. ' Item_code ' =b. ' Item_code ' WHERE t. ' SKU ' = ' ". $asin." ' OR T. ' ASIN ' = ' ". $asin." ' OR T. ' Item_code ' = ' ". $asin." ' "; $query =mysql_query ($sql); $rs =mysql_fetch_array ($query); $num = Mysql_affected_rows (); Echo $sql. "
"While ($rs =mysql_fetch_array ($query)) {echo $rs [' Pack_weight '];echo $rs [' Item_code '];echo $rs [' Package_area ']; echo "
";}


This statement can find the record in phpMyAdmin, I execute this statement in PHP but I can't find the record.


Reply to discussion (solution)

Do you have any error messages?

If the result is only one, then you can not get the output!
Remove the $rs =mysql_fetch_array ($query) from line 7th;

When you loop through the data, you start with the second data and comment out the seventh line

fainted, one more

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