[eluser]fdog[/eluser]
Can't connect to postgres. All services are running and the data base and tables were created. The port is right. (triple checked).
database.php:
Code:
$active_group = "default";
$active_record = TRUE;
$db['default']['hostname'] = "localhost";
$db['default']['username'] = "user";
$db['default']['password'] = "password";
$db['default']['database'] = "mydb";
$db['default']['dbdriver'] = "postgre";
$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']['port'] = 5432;
controller:
Code:
class Fooclass extends Controller {
function Fooclass()
{
parent::Controller();
$this->load->helper('html');
$this->load->helper('url');
$this->load->database(); //also tried in autoload.php (not at the same time)
}
function index()
{
$this->load->view('includes/top_view');
$this->load->view('body_view');
$this->load->view('includes/sidebar_view');
$this->load->view('includes/footer_view');
}
}
The weirdest is that there is no error message, only a blank page. If I remove the $this->load->database() line, the thing works like a charm.