Welcome Guest, Not a member yet? Register   Sign In
How to load database as run time?
#1

[eluser]Amit Patel[/eluser]
Hello All

How can i configure database information runtime means i have to change the database at run time the db info coming from database so how can i switch database at run time.

can i use something this way

Code:
config['hostname']= ****
config['username']= ****
config['passowrd']= ****


$this->load->database($config)

I don't know how to use it plz help me
#2

[eluser]Mike Ryan[/eluser]
Hi Amit,

I don't fully understand your question, but I'm pretty sure you need to read this: http://ellislab.com/codeigniter/user-gui...cting.html, which describes how to choose from a number of different "option groups" at runtime.

If you want more flexibility than this you will probably need to extend the core DB code.
#3

[eluser]Amit Patel[/eluser]
Thanks for your reply,

Actually i want to switch database runtime. so if i defined the db group in database.php then it work's fine.But when i connect it to manually as define above it is not connecting.




Theme © iAndrew 2016 - Forum software by © MyBB