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!