|
$condition='never or now';
$this->db->select('*')->where('xx', $condition)->get('tablename')
echo $this->db->last_query(); //select * from tablename where xx = 'nerver or now'; (or 和now中间有两个空格)
有解决方案吗?跟了一下代码发现是,DB_query_builder.php 中的function _compile_wh()导致的,里面有个正则
$conditions = preg_split(
'/((^|\s+)AND\s+|(^|\s+)OR\s+)/i',
$this->{$qb_key}[$i]['condition'],
-1,
PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY
); |
|