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

[eluser]CMCDragonkai[/eluser]
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:

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

So that this can be done:

Code:
$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?


Messages In This Thread
Database Prefix Problem - by El Forum - 11-30-2010, 12:24 AM
Database Prefix Problem - by El Forum - 11-30-2010, 12:48 AM
Database Prefix Problem - by El Forum - 11-30-2010, 01:07 AM
Database Prefix Problem - by El Forum - 11-30-2010, 01:44 AM
Database Prefix Problem - by El Forum - 11-30-2010, 02:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB