博客列表 >tp5多where条件

tp5多where条件

夏日的烈风的博客
夏日的烈风的博客原创
2018年06月14日 13:51:251621浏览

   $where[]='1=1';  

            if(!empty($arr['is_hot  '])){  

                $a = $arr['is_hot'];  

                $where[]= 'is_hot ='."$a";  

            }  

            if(!empty($arr['is_show'])) {  

                $b = $arr['is_show'];  

                $where[] = 'is_show =' . "$b";  

            }  

            if(!empty($arr['t_id'])) {  

                $d = $arr['t_id'];  

                $where[] = 'sg_fruits.t_id ='."$d";  

            }  

            if(!empty($arr['f_name'])) {  

                $c = $arr['f_name'];  

                $where[] = 'f_name  like \'%' . "$c".'%\'';  

            }  

  

            $wh=implode(' AND ',$where);  


声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议