Welcome Guest, Not a member yet? Register   Sign In
Help with the dbprefix method
#1

[eluser]Unknown[/eluser]
Hello everybody!!

I need some help with the dbprefix config in CI 2.0.3.
By searching the forum, I've found this post : http://ellislab.com/forums/viewthread/87829/#442426
And over there, Colin Williams said that "The dbprefix method just returns a string. It does not alter your queries.".
But since the post is from 2006, I believe that this behavior has changed since.
I'm using dbprefix and it IS altering my queries. It adds the prefix automatically.

Problem is:
I'm using prefixes to identify different languages in the database, like es_table, pt_table, en_table and so on.
And I'm changing the prefix with
Code:
$this->db->set_dbprefix($this->session->userdata('lang'))
But some of the tables are common to all languages, like images, and have no prefix at all.
If the dbprefix method worked like, apparently, it used to work I could just add the method to the queries that use those prefixed tables and use
Code:
$this->db->get($this->db->dbprefix('table'));

Does anyone know if theres a way to change that?




Theme © iAndrew 2016 - Forum software by © MyBB