如何使用 cakephp & 使用 LIKE OR 运算符mysql [英] How to use LIKE OR operator using cakephp & mysql
本文介绍了如何使用 cakephp & 使用 LIKE OR 运算符mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是 cakephp 的新手 &不知道使用 LIKE & 的语法是什么OR 运算符在 cakephp 和 mysql 中.
I am new to cakephp & don't know what is the syntax to use LIKE & OR operator in cakephp with mysql.
谁能帮帮我?谢谢..
推荐答案
复杂的查找条件来自手册:
$this->Post->find('first', array (
"Author.name" => "Bob",
"OR" => array (
"Post.title LIKE" => "%magic%",
"Post.created >" => date('Y-m-d', strtotime("-2 weeks"))
)
));
这篇关于如何使用 cakephp & 使用 LIKE OR 运算符mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文