假设我想获取文本列中包含三个单词(word1、word2、word3)的所有行
所以我的sql是
SELECT
*
FROM
mytable
WHERE
col_text LIKE '%word1%'
AND col_text LIKE '%word2%'
AND col_text LIKE '%word3%'
codeigniter中有and_like吗?
向查询生成器提供三个
like()
将假设每个都默认为 AND
:
$this->db
->from( "mytable" )
->like( "col_text", 'word1', 'both' )
->like( "col_text", 'word2', 'both' )
->like( "col_text", 'word3', 'both' );