我想在CodeIgniter中调用我的存储过程,但没有任何作用。我向free_db
添加了一个名为mysqli_result
的新功能,但它仍然无法正常工作。它给了我结果,但错误仍然存在。我该如何解决这个问题?
控制器
public function best_selling(){
$data = $this->graph->getGraph();
print_r($data);
}
模型
public function getGraph(){
$data = $this->db->query('CALL storelte_best_selling()');
return $data->result_array();
}
设置数据库
$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
);