【发布时间】:2016-12-16 21:30:02
【问题描述】:
在以前的版本 2.2.6 中,我使用以下代码:
$this->db->_protect_identifiers=false;
$dataField='tm.*,IFNULL(CONCAT_WS(" " ,pm.firstName,pm.lastName),"") as assignedToName,IFNULL(cm.caseNo,"") as CaseNo,IFNULL(cm1.fileNo,"") as fileNo,IFNULL(sm.caseStage,"") as caseStage';
$qryTable='task_mst as tm
LEFT JOIN case_mst as cm on tm.caseNo=cm.ID
LEFT JOIN case_mst as cm1 on tm.fileNo=cm1.ID
LEFT JOIN party_mst as pm on tm.assignedTo=pm.ID
LEFT JOIN session_mst as sm on tm.sessionId=sm.ID';
$task= $this->db->select($dataField,false)->from($qryTable)->where($where,NULL,FALSE)->order_by("ID","desc")->limit(10)->get()->result_array();
现在我使用的是 3.1.0 版,但是“_protect_identifiers”会给出错误信息
Fatal error: Cannot access protected property CI_DB_mysqli_driver::$_protect_identifiers
谁能告诉我如何在 codeigniter 3.1.0 中使用“protect_identifiers()”?
【问题讨论】:
-
也许它现在需要一个访问器方法,例如
set_protect_identifiers(false);或它的一些变体。如果是,请告诉我,我将作为答案发布。
标签: php codeigniter codeigniter-3