[eluser]bill19[/eluser]
Thanks CroNix,
I've actually read that article. ( I got it from you last week ). I have everything setup as in the article. In fact, everything else in the 'Main' controller is working . I was able to check that $this->user which was declared in a parent controller is available in the 'Main' controller, as expected. However I still am not able to change databases. Here are my controllers in more detail:
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
$this->load->database('wo');
//
/* ------------------ */
$this->load->library('grocery_CRUD');
}
public function index()
{
echo "<h1>Welcome to the world of Codeigniter</h1>";//Just an example to ensure that we get into the function
die();
}
public function listings()
{
var_dump($this->the_user);
echo 'in home listing';
echo "<pre>";
print_r($this->db->list_tables());
die();
Code:
class Common_Auth_Controller extends MY_Controller {
protected $the_user;
function __construct() {
parent::__construct();
if($this->ion_auth->logged_in()) {
$data->the_user = $this->ion_auth->user()->row();
$this->the_user = $data->the_user;
$this->load->vars($data);
}
else {
redirect('/');
}
}
}
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Controller extends CI_Controller {
function __construct() {
parent::__construct();
// parent::Controller();
$this->load->library('ion_auth');
$this->load->library('session');
$this->load->library('form_validation');
$this->load->database();
$this->load->helper('url');
}
}
I am stumped , and would appreciate any ideas you may have.
Thank you,
Bill