sql >> Base de Datos >  >> RDS >> Mysql

Llamar al procedimiento almacenado en codeigniter

Sigo el blog del Sr. Tim Brownlaw:
http://ellislab. com/foros/viewthread/73714/#562711

Primero, modifique application/config/config.php, línea 55.

$db['default']['dbdriver'] = 'mysqli'; // USE mysqli

Luego, agregue lo siguiente en mysqli_result.php al que le falta este comando por alguna extraña razón (en /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);
     }
 }

Luego, en su modelo, agregue $result->next_result() .

A continuación se muestra mi ejemplo.

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;
}