Remove double quotation marks in codeigniter query builder

1

I'm using the Codeigniter framework and every time I create a select with query builder of them, it puts double quotes in all columns and tables.

Ex: SELECT "ID", "NAME" FROM "STUDENT"

This gives me a problem because I use 2 connections to the database, oracle, and pgsql. In oracle works normally, as long as pgsql returns me error.

I know that if I put the last parameter in my functions as false, it works, but I wanted to know if it has a global parameter to do this, or am I going to have to pass method by method false?     

asked by anonymous 06.06.2017 / 14:04

2 answers

1

Use this line before your query (documentation here ):

$this->db->_protect_identifiers = false;

For a global parameter, in the ./application/config/database.php (database configuration file) file, add a new element to array of default settings:

$db['default']['_protect_identifiers'] = false;
    
06.06.2017 / 14:56
0

CodeIgniter has a second parameter in the query builder to avoid word escaping, see this link with the documentation, but in short you can use something like this:

$this->db->select('campo', false)
    
06.06.2017 / 14:38