Welcome Guest, Not a member yet? Register   Sign In
database connectivity problem
#1

[eluser]sawatdee[/eluser]
I am getting an error that says, "Unable to select the specified database: mydatabase", when I try to load my database. I am using CodeIgniter 1.6.0.

Here is the configuration array in my config file.
Code:
$active_group = "local";
$active_record = TRUE;

$db['local']['hostname'] = "localhost";
$db['local']['username'] = "username";
$db['local']['password'] = "password";
$db['local']['database'] = "mydatabase";
$db['local']['dbdriver'] = "mysql";
$db['local']['dbprefix'] = "";
$db['local']['pconnect'] = TRUE;
$db['local']['db_debug'] = TRUE;
$db['local']['cache_on'] = FALSE;
$db['local']['cachedir'] = "";
$db['local']['char_set'] = "utf8";
$db['local']['dbcollat'] = "utf8_general_ci";

And here is the controller code I am using to load it. I am not autoloading the database library.
Code:
$table_data = array ();
$table_data ['column1'] = $data1;
$table_data ['column2'] = $data2;
$table_data ['column3'] = $data3;
        
$this->load->database ('local');
$this->db->insert ('mytable', $table_data);

I previously used CodeIgniter 1.5.4 and the database code worked prefectly. Some things have changed in version 1.6.0 and I am wondering if anyone else has had this problem, or if anyone can see something in my code that I am doing wrong.
#2

[eluser]Clooner[/eluser]
Change username?




Theme © iAndrew 2016 - Forum software by © MyBB