tp笔记


2.查询条件

1.通过where函数实现对查询添加条件

$where[] = ['m_id','=',1];
$where[] = ['wx_gender','=',1];
Db::name('member')->where($where)->select();

以上运行结果相当于以下语句

select * from cmf_member where m_id=1 and wx_gender=1

2.模糊查询

$where[] = ['wx_gender','=',1];
$where[] = ['wx_name',"like","%pei%"];
Db::name('member')->where($where)->select();

以上运行结果相当于以下语句

select * from cmf_member where m_id=1 and wx_name like "%pei%"

页面列表

ITEM_HTML