Can't connect to multiple databases - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Can't connect to multiple databases (/showthread.php?tid=8131) |
Can't connect to multiple databases - El Forum - 05-06-2008 [eluser]neen[/eluser] I am following the below user guide page for connecting to multiple databases: http://ellislab.com/codeigniter/user-guide/database/connecting.html I have the following code in my admin controller: Code: <?php And I get the following error Quote:A PHP Error was encountered Any ideas? I am 100% sure my database.php file is correct... Can't connect to multiple databases - El Forum - 05-06-2008 [eluser]neen[/eluser] Nevermind, I figured it out.... Can't connect to multiple databases - El Forum - 08-10-2008 [eluser]browntown[/eluser] Care to share what you did to fix this? Can't connect to multiple databases - El Forum - 08-10-2008 [eluser]Colin Williams[/eluser] In class methods and functions in general, when you define a variable inside the method/function, it is only available inside the method/function. So, just because you defined the variable in the constructor doesn't mean it's available later in index(). With classes, you can share variables between methods by defining them as properties (like $this->eyebeam, $this->agilevoice). |