继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

foreach 遍历要点 foreach遍历查询 将两个表里面的每一天记录都出来了

傲慢的飞行员3734838
关注TA
已关注
手记 9
粉丝 2
获赞 40

$list = $money_num -> where($name)->limit($Page->firstRow.','.$Page->listRows)->select();

        foreach($list as $k => $name){
            $zz_id = $name['zhuanzhang_id'];
            $name_p = $tr -> where('userid='.$zz_id) -> getField('username');
            $list[$k]['zz_name']=$name_p;
        }

例子二:
public function index(){
$type = I('shop_type');
$msg = M('product');
$msg_shop = M('shopkucun');
$where['s_id']=6;
$arr = $msg_shop-> where($where)-> order("p_id") -> select();
foreach($arr as $v){
$where['p_id']=$v['p_id'];
$msg_detail[] = $msg -> where($where) -> find();
}

    $this-> assign('msg_detail',$msg_detail);
    $this->display('service');
}
打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP