[eluser]bill19[/eluser]
Thanks, however I still seen to be doing something wrong.
I have changed my 'Main' controller to add a $DB1 and $DB2 , like so:
Code:
class Main extends Common_Auth_Controller {
//class Main extends CI_Controller {
function __construct()
{
parent::__construct();
//do stuff here -
// remember that $this->the_user is available in this controller
//as is $the_user available in any view I load
/* Standard Libraries of codeigniter are required */
//
// $this->load->helper('url');
/* ------------------ */
$this->load->library('grocery_CRUD');
$DB1 = $this->load->database('default', TRUE);
$DB2 = $this->load->database('wo', TRUE);
}
public function listings()
{
var_dump($this->the_user);
echo 'in home listing';
echo "<pre>";
print_r($this->db->list_tables());
echo "<pre>";
print_r($this->DB2);
my /config/database file looks like:
Code:
$active_group = 'default';
$active_record = TRUE;
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = '***';
$db['default']['password'] = '***';
$db['default']['database'] = 'ion_auth';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
$db['wo']['hostname'] = 'localhost';
$db['wo']['username'] = '***';
$db['wo']['password'] = '*****';
$db['wo']['database'] = '*****92';
$db['wo']['dbdriver'] = 'mysql';
$db['wo']['dbprefix'] = '';
$db['wo']['pconnect'] = TRUE;
$db['wo']['db_debug'] = TRUE;
$db['wo']['cache_on'] = FALSE;
$db['wo']['cachedir'] = '';
$db['wo']['char_set'] = 'utf8';
$db['wo']['dbcollat'] = 'utf8_general_ci';
$db['wo']['swap_pre'] = '';
$db['wo']['autoinit'] = TRUE;
$db['wo']['stricton'] = FALSE;
I am getting the following error:
Quote:Message: Undefined variable: DB2
Filename: controllers/Main.php
Line Number: 43
What am I doing wrong?
Thanks,
Bill