Welcome Guest, Not a member yet? Register   Sign In
Database Prefix Problem

I set my database prefix to 'ci_' in order to better separate my ci tables from phpbb's tables.

Now when I try to access phpbb's table, CI automatically adds ci_ to the tablenames. Now phpbb's table names do not have ci_. It has phpbb_. Is there was to tell CI to ignore db prefix for certain queries?

ci_ is a reserved name!


I don't understand!

I found out that manual queries ignore table prefix. I also found out that there is a way to add table prefix to manual queries:

According to this: http://crynobone.com/database-table-pref...deigniter/

In config/database.php

One can do this:

$db['default']['dbprefix'] = "feed_";  
$db['default']['swap_pre'] = "{PRE}";

So that this can be done:

$sql = "SELECT * FROM {PRE}item";  
$query = $this->db->query($sql);

The {PRE} becomes feed_.

But swap_pre is not config.php which leads me to think that this is CI 2.0 feature.

Here it means swap_pre for 2.0 http://philsturgeon.co.uk/news/2010/03/codeigniter-2

Will there be a day where we will be able to use this?

Create a second database config for the same database, but without the prefix. Then use $this->db to access the default database (with prefix) , and
$this->phpbb = $this->load->database('phpbb', TRUE);
to access the phpbb tables.

Theme © iAndrew 2016 - Forum software by © MyBB