例如 select * from tbl where a like '%123%' or b like '%123%' or c like '%123%' ;
實現這樣的功能,thinkphp怎么寫呢?
貌似where['a']=array('like',"%123%");
where['b']=array('like',"%123%");
where['c']=array('like',"%123%");
這樣下來,abc三個字段是且(and)的關系,不是或(or)啊
實現這樣的功能,thinkphp怎么寫呢?
貌似where['a']=array('like',"%123%");
where['b']=array('like',"%123%");
where['c']=array('like',"%123%");
這樣下來,abc三個字段是且(and)的關系,不是或(or)啊
答案來自:http://www.thinkphp.cn/topic/28308.html