Rumah > pembangunan bahagian belakang > tutorial php > 为什么最后一个var_dump()只能打印一个数组

为什么最后一个var_dump()只能打印一个数组

WBOY
Lepaskan: 2016-06-06 20:45:02
asal
1054 orang telah melayarinya

<code>    $orderQuery = "select sum(`goods`.goods_nums) goods_nums,goods.goods_id,goods.goods_array,goods.product_id,goods.goods_price 
    from iwebshop_order `order` 
    join 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");
    $orderResult =  $njhl->query($orderQuery,'select');

    if($orderResult)
    {
        foreach($orderResult 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)query($stockQuery,'select');

                    var_dump($stockResult);
                }
            }
        }

    }
</code>
Salin selepas log masuk
Salin selepas log masuk

查询是有多条数据的!

回复内容:

<code>    $orderQuery = "select sum(`goods`.goods_nums) goods_nums,goods.goods_id,goods.goods_array,goods.product_id,goods.goods_price 
    from iwebshop_order `order` 
    join 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");
    $orderResult =  $njhl->query($orderQuery,'select');

    if($orderResult)
    {
        foreach($orderResult 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)query($stockQuery,'select');

                    var_dump($stockResult);
                }
            }
        }

    }
</code>
Salin selepas log masuk
Salin selepas log masuk

查询是有多条数据的!

Label berkaitan:
sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan