![]() |
Multiple Database Connection (run time) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Multiple Database Connection (run time) (/showthread.php?tid=17080) |
Multiple Database Connection (run time) - El Forum - 03-25-2009 [eluser]Amit Patel[/eluser] Hello All, I want to connect database at runtime . It is working when i define database info in database.php and connect it using $this->load->database('group_name',TRUE) where group name is define in config/database.php . But when i create connection at runtime using (as help is givne in datbase class but it's not working) Code: $config['hostname'] = "localhost"; $this->load->database($config); the database is not connected and use old database so how can i connect the database at run time because i have stored the mysql info in the database table so i have to connect database runtime i can't define in database.php.... so how can i do this.. when i print $dbObj i got You have not selected a database type to connect to. so how can i get connection object at runtime... Please help me. |