Change database in controller |
[eluser]huzzel[/eluser]
Hi, i tried to add a dynamic database via dsn or $db but it wont connect :-( Code: function view($id){
[eluser]pistolPete[/eluser]
Did you really just copy that line from the user guide and expected it to work? Code: $dsn = 'dbdriver://username:password@XXXX/database...'; You need to build the $dsn string using your config settings: Code: $dsn = 'mysql://'.$data['site']->mysql_user.':'.$data['site']->mysql_pw.'@'.$data['site']->mysql_ip.'/'.$data['site']->mysql_db.';
[eluser]huzzel[/eluser]
yes and $db_current is still empty :-( Code: <?php
[eluser]pistolPete[/eluser]
Read the user guide: http://ellislab.com/codeigniter/user-gui...cting.html Quote:Connecting to Multiple Databases
[eluser]huzzel[/eluser]
oh ^_^ thx for your help :-) i am really new to ci. I think it would be better if someone could create a new category here with "newbie questions" ^^ |
Welcome Guest, Not a member yet? Register Sign In |