假设我想获取包含三个单词(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' );