假設我想獲取包含三個單詞(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 嗎?
uj5u.com熱心網友回復:
like()默認情況下AND,向查詢構建器提供三個假設:
$this->db
->from( "mytable" )
->like( "col_text", 'word1', 'both' )
->like( "col_text", 'word2', 'both' )
->like( "col_text", 'word3', 'both' );
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/318716.html
上一篇:如何從我的表中獲取最后一條記錄?
