I use codeigniter 2.2.0
I connect to DB and when i fetch from DB first time it's ok, but when I refresh page id get error:
A Database Error Occurred
Unable to select the specified database: portino
Filename: D:\xampp\htdocs\citest.pc\system\database\DB_driver.php
Line Number: 140
what is wrong with code? I tried with an older version 2.1.4 it same error... Yes portino
exist I use xampp
The database.php
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'root';
$db['default']['password'] = '';
$db['default']['database'] = 'portino';
$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;
The autoload.php
$autoload['libraries'] = array('database');
And simple controller citest.php
public function selDb() {
$qr = $this->db->query('select * from comments');
var_dump($qr->result());
}
that is all my code