Welcome Guest, Not a member yet? Register   Sign In
dbprefix([$table = ''])
#2

(10-25-2015, 07:59 AM)ComputingFroggy Wrote: Hi,

reading the manual on dbprefix, I would have thought to get the prefix used one could write :

Code:
    $thePrefix=$this->db->dbprefix('');

However this fires up an error asking for a table name.
Considering the documentation states the table name is optional (and empty), I thought I could get the prefix that way.

Instead, I am doing:

Code:
        $thePrefix=substr($this->db->dbprefix('X'), 0, -1);
Not particularly elegant, but that works.

I would think either the documentation or the method behaviour should be changed.


Cheers,
[email protected]

I think you can retrieve it with:
  • $this->db->dbprefix; // Making before $this->load->database();
  • $this->config->item('dbprefix', 'database');
Greetings.
Reply


Messages In This Thread
dbprefix([$table = '']) - by ComputingFroggy - 10-25-2015, 07:59 AM
RE: dbprefix([$table = '']) - by rtorralba - 10-25-2015, 08:15 AM
RE: dbprefix([$table = '']) - by PaulD - 10-25-2015, 08:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB