Why the last Var_dump () can only print an array

Source: Internet
Author: User
    erQuery = "Select sum (' goods '. Goods_nums) goods_nums,goods.goods_id,goods.goods_array,goods.product_id, Goods.goods_price from Iwebshop_order ' order ' joins iwebshop_order_goods ' goods ' on ' order '. id = ' goods '. Order_     ID where ' order '. Status = ' 5 ' and unix_timestamp (' order '. create_time) between ' ". $begin." ' and ' ". $end." '    GROUP BY ' goods '. goods_id ";    $NJHL = new MYSQL ("127.0.0.1", "Root", "" "," test1 ");    erResult = $NJHL->query (erQuery, ' select ');  if (erResult) {foreach (erResult as $item) {$goodsQuery = "Select Goods_no,huo_no from            Goods where id = ". $stock [' goods_id '];            $goodsResult = $NJHL->query ($goodsQuery, ' select ');  if ($goodsResult) {foreach ($goodsResult as $goods) {$goods _no                    = Trim ($goods [' goods_no ']);                    $goods _huo = Trim ($goods [' huo_no ']);                    $where; if ($goods _no{$goods _no = strlen ($goods _no) <10?str_pad ($goods _no, ten, ' 0 ', str_pad_left):                        $goods _no;                    $where = "Info.item_no = '". $goods _no. "'"; } else {$goods _huo = strlen ($goods _huo) <5?str_pad ($goods _                        Huo, 5, ' 0 ', str_pad_left): $goods _huo;                    $where = "Info.item_huo = '". $goods _huo. "'";                    } $stockQuery = "SELECT * FROM info join the stock on stock.item_no = Info.item_no where". $where;                    $hsh = new MYSQL ("127.0.0.1", "Root", "" "," test2 ");                    $stockResult = $hsh->query ($stockQuery, ' select ');                Var_dump ($stockResult); }            }        }    }

The query has more than one piece of data!

Reply content:

    erQuery = "Select sum (' goods '. Goods_nums) goods_nums,goods.goods_id,goods.goods_array,goods.product_id, Goods.goods_price from Iwebshop_order ' order ' joins iwebshop_order_goods ' goods ' on ' order '. id = ' goods '. Order_     ID where ' order '. Status = ' 5 ' and unix_timestamp (' order '. create_time) between ' ". $begin." ' and ' ". $end." '    GROUP BY ' goods '. goods_id ";    $NJHL = new MYSQL ("127.0.0.1", "Root", "" "," test1 ");    erResult = $NJHL->query (erQuery, ' select ');  if (erResult) {foreach (erResult as $item) {$goodsQuery = "Select Goods_no,huo_no from            Goods where id = ". $stock [' goods_id '];            $goodsResult = $NJHL->query ($goodsQuery, ' select ');  if ($goodsResult) {foreach ($goodsResult as $goods) {$goods _no                    = Trim ($goods [' goods_no ']);                    $goods _huo = Trim ($goods [' huo_no ']);                    $where; if ($goods _no{$goods _no = strlen ($goods _no) <10?str_pad ($goods _no, ten, ' 0 ', str_pad_left):                        $goods _no;                    $where = "Info.item_no = '". $goods _no. "'"; } else {$goods _huo = strlen ($goods _huo) <5?str_pad ($goods _                        Huo, 5, ' 0 ', str_pad_left): $goods _huo;                    $where = "Info.item_huo = '". $goods _huo. "'";                    } $stockQuery = "SELECT * FROM info join the stock on stock.item_no = Info.item_no where". $where;                    $hsh = new MYSQL ("127.0.0.1", "Root", "" "," test2 ");                    $stockResult = $hsh->query ($stockQuery, ' select ');                Var_dump ($stockResult); }            }        }    }

The query has more than one piece of data!

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