1
我使用活動記錄有問題,如果我有這樣的笨條件在當字段名稱包含空格
$data_array = array(
'Code Employee' => 'AC01',
'Status Employee' => 'Y'
);
$this->db->where($data_array);
$this->db->get('masteremp');
echo $this->db->last_query();
//Output query will be
SELECT * FROM masteremp WHERE `Code` `Employee` = 'AC01' AND `Status` `Employee` = 'Y'
我嘗試編輯DB_query_builder活動記錄,我添加此線2430
if(!empty($conditions)){
for($index = 0; $index < sizeof($conditions); $index++){
if (strpos($conditions[$index], '` `') !== false) {
$conditions[$index] = str_replace('` `', ' ', $conditions[$index]);
}
}
}
你有空間領域的方法嗎?我覺得我的方法是不是效率..感謝..
最初使它像這樣: - '$ data_array中=陣列( 'CodeEmployee'=> 'AC01', 'StatusEmployee'=> 'Y' );' –