ThinkPHP操作SQL的问题

浏览:922 发布日期:2013/09/12 分类:求助交流 关键字: SQL
这条SQL语句怎么把AND换成OR啊?
$_db = D('SeachAskInfoView');
$_seach = $_db->where(array('content'=>array('LIKE','%'.$_keyword.'%'),'acontent'=>array('LIKE','%'.$_keyword.'%')))->select();

输出出来是这样的:
SELECT ask.id AS id,ask.content AS content,ask.reward AS reward,ask.time AS time,ask.answer AS answer,answer.content AS acontent,category.name AS name FROM wd_ask ask LEFT JOIN wd_answer answer ON ask.id = answer.aid LEFT JOIN wd_category category ON ask.cid = category.id WHERE ( ask.content LIKE '%php%' ) AND ( answer.content LIKE '%php%' )

最佳答案
评论( 相关
后面还有条评论,点击查看>>