• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can't connect to multiple databases

#1
[eluser]neen[/eluser]
I am following the below user guide page for connecting to multiple databases:

http://ellislab.com/codeigniter/user-gui...cting.html

I have the following code in my admin controller:

Code:
<?php

    class admin extends Controller {
        
        function __construct()
        {
            parent::Controller();
            $agilevoice = $this->load->database('agilevoice', TRUE);
            $eyebeam = $this->load->database('eyebeam', TRUE);
        }
        
        function index()
        {
            
            $agilevoice->get('ab_product');
            
        }
        
        
    }


?>

And I get the following error

Quote:A PHP Error was encountered

Severity: Notice

Message: Undefined variable: agilevoice

Filename: controllers/admin.php

Line Number: 15

Fatal error: Call to a member function get() on a non-object in /Volumes/Storage/Projects/ispcalling/system/application/controllers/admin.php on line 15

Any ideas? I am 100% sure my database.php file is correct...


Messages In This Thread
Can't connect to multiple databases - by El Forum - 05-06-2008, 02:30 PM
Can't connect to multiple databases - by El Forum - 05-06-2008, 02:56 PM
Can't connect to multiple databases - by El Forum - 08-10-2008, 07:58 PM
Can't connect to multiple databases - by El Forum - 08-10-2008, 09:13 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.