本文介绍了codeigniter 3.1.0中的protect_identifiers问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在以前的版本2.2.6中,我正在使用以下代码:

In Previous version 2.2.6 i was using following code:

$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将给出错误消息

Now i am using Version 3.1.0 but "_protect_identifiers" will give error message

Fatal error: Cannot access protected property CI_DB_mysqli_driver::$_protect_identifiers

有人可以告诉我如何在codeigniter 3.1.0中使用 protect_identifiers()吗?

Can anyone tell me how to use "protect_identifiers()" in codeigniter 3.1.0?

推荐答案

这是一个示例

return 'SELECT '.$this->escape_identifiers('name')
            .' FROM '.$this->escape_identifiers('sysobjects')
            .' WHERE '.$this->escape_identifiers('type')." = 'U'";

这篇关于codeigniter 3.1.0中的protect_identifiers问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 13:40