Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

Chamando o procedimento armazenado no codeigniter


Sigo o blog do Sr. Tim Brownlaw:
http://ellislab. com/forums/viewthread/73714/#562711

Primeiro, modifique application/config/config.php, linha 55.
$db['default']['dbdriver'] = 'mysqli'; // USE mysqli

Em seguida, adicione o seguinte em mysqli_result.php que está faltando este comando por algum motivo estranho (em /system/database/drivers/mysqli/mysqli_result.php).
/**
  * Read the next result
  *
  * @return  null
  */   
 function next_result()
 {
     if (is_object($this->conn_id))
     {
         return mysqli_next_result($this->conn_id);
     }
 }

Então, em seu modelo, adicione $result->next_result() .

Abaixo está o meu exemplo.
function list_sample($str_where, $str_order, $str_limit)
{
   $qry_res    = $this->db->query("CALL rt_sample_list('{$str_where}', '{$str_order}', '{$str_limit}');");

   $res        = $qry_res->result();

   $qry_res->next_result(); // Dump the extra resultset.
   $qry_res->free_result(); // Does what it says.

   return $res;
}