I want to call my stored procedure in CodeIgniter, but nothing works. I added a new function called free_db
to mysqli_result
, but it still doesn't work. It gives me the result, but the error persists. How can I fix this?
Controller:
public function best_selling() {
$data = $this->graph->getGraph();
print_r($data);
}
Model:
public function getGraph() {
$data = $this->db->query('CALL storelte_best_selling()');
return $data->result_array();
}
Setting database:
$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => '**********',
'password' => '*********',
'database' => 'storelte',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);