I really i don't know what is wrong in my code. It fails when reach the line $this->load->database();
The code don't thrown any exception/error.
club_controller
public function guardar(){
$data = array(
'id' => $this->input->post('nombredentificador'),
'nombre' => $this->input->post('nombreclub'),
'estado' => True
);
$this->load->model('club_model');
$this->club_model->save($data);
}
club_model
class Club_model extends CI_Model{
function __construct(){
parent::__construct();
$this->load->database();
}
public function save($data){
$this->db->insert('Club', $data);
}
database.php
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'root';
$db['default']['password'] = '';
$db['default']['database'] = 'Natacion';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
I use MySql Workbench, database name is Natacion