[eluser]Bl4cKWid0w[/eluser]
Try using this:
Code:
if($this->form_validation->run() == FALSE){
$config['hostname'] = "localhost";
$config['username'] = "myusername";
$config['password'] = "mypassword";
$config['database'] = "mydatabase";
$config['dbdriver'] = "mysql";
$config['dbprefix'] = "";
$config['pconnect'] = FALSE;
$config['db_debug'] = TRUE;
$config['cache_on'] = FALSE;
$config['cachedir'] = "";
$config['char_set'] = "utf8";
$config['dbcollat'] = "utf8_general_ci";
$this->load->database($config);
} else {
$this->load->view('form_success');
}
Change all the variables to match your database information.
Taken from the userguide.