Welcome Guest, Not a member yet? Register   Sign In
dynamically setting dbprefix?
#1

[eluser]Unknown[/eluser]
I have an application where I need to have the dbprefix set dynamically when a user logs in. My thought was that I could set the dbprefix value to the user session and the queries in the models would simply read the session. My problem is that I'm not sure how to dynamically set the dbprefix on the fly. Is there a call I can make to set the current config to change the dbprefix value? I imagine that I could just set a variable to use in the statements, but it seems like a better idea to maintain the coding standard of using the dbprefix feature that ci has.
#2

[eluser]imn.codeartist[/eluser]
try this
$this->db->dbprefix='your prefix';
#3

[eluser]InsiteFX[/eluser]
Read the users guide!

Enjoy
InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB