Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

protect_identifiers issue in codeigniter 3.1.0

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();

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

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

like image 291
Bhavika Kathiriya Avatar asked Sep 04 '26 18:09

Bhavika Kathiriya


1 Answers

Simply remove the _ from the $this->db->_protect_identifiers. (Underscore Symbol)

$this->db->protect_identifiers=false;

This is the change CI made in new version.

like image 182
Jimil Choksi Avatar answered Sep 07 '26 08:09

Jimil Choksi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!