How to handle basic functions

Source: Internet
Author: User
Functionjieri ($ jieri) {$ SQL = & quot; SELECTgoods_id, goods_thumb, goods_name, shop_price, market_priceFROMhc_goodsWH
Function jieri ($ jieri ){
$ SQL = "SELECT goods_id, goods_thumb, goods_name, shop_price, market_price FROM hc_goods WHERE goods_id in (SELECT goods_id FROM hc_goods_attr WHERE attr_value = '". $ jieri. "') order by goods_id desc limit 5 ";
Global $ db;
$ Result = $ db-> getAll ($ SQL );
Return $ result;
}
$ SQL = "SELECT jieri_name FROM hc_shouye_jieri ";
$ Result1 = $ db-> getAll ($ SQL );

Echo $ a = $ result1 [0] ['jieri _ name']; // output
$ Jieri1 = jieri ("$ ");

Print_r ($ jieri1); // it cannot be printed here

Function print_r ($ jieri1); print it out. if echo $ a = $ result1 [0] ['jieri _ name'] = "assign value", print it out.

What's going on?

------ Solution --------------------
Function jieri ($ jieri ){
Echo $ jieri; // What is it?
$ SQL = "SELECT goods_id, goods_thumb, goods_name, shop_price, market_price FROM hc_goods WHERE goods_id in (SELECT goods_id FROM hc_goods_attr WHERE attr_value = '". $ jieri. "') order by goods_id desc limit 5 ";
Global $ db;
$ Result = $ db-> getAll ($ SQL );
Print_r ($ result); // check what is going on?
Return $ result;
}

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.