I'm new using postgresql and I've been using Codeigniter for a year.
I have a small postgresql database and I wanna call it from Codeigniter.
In my database.php file I have this setup:
$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
'dsn' => 'pgsql:host=localhost;port=5432;dbname=test;user=postgres;password=aPass',
// 'dsn' => '',
'hostname' => 'localhost',
'username' => 'postgres',
'password' => 'aPass',
'database' => 'test',
'dbdriver' => '',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => TRUE,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
// 'port' => '5432'
);
In a controller I have this function:
public function dbtest(){
$this->load->database();
$feeds = $this->db->get('vts_feeds');
echo $feeds;die();
}
The result I'm getting is:
An Error Was Encountered
You have not selected a database type to connect to.
Why is it not working?