[eluser]mooooo[/eluser]
NOTE! I fixed it by simple fetching the second empty result set from the stored procedure call.
In system/database/drivers/mysqli/mysqli_result.php I added the following function:
Code:
function next_result()
{
if (is_object($this->conn_id))
{
return mysqli_next_result($this->conn_id);
}
}
...and in my model I simple did $result->next_result(); after the stored procedure call.
My issue is shown below
- - - - - - - -
Hi,
I have a issue connected to this thread. I'm using stored procedures with MySQLi and the procedure is working splendid. My problem is when I try to make another standard SQL query. I get the following error:
Code:
Error Number: 2014
Commands out of sync; you can't run this command now
Below are my two model functions:
Code:
function get() {
$startdate = date('Y-m-d');
$enddate = '2010-10-01';
$query = 'CALL get_calendar("?", "?")';
$result = $this->db->query($query, array($startdate, $enddate));
return $result->result_object();
}
function unavailable_weeks() {
$query = 'SELECT * FROM weeks_unavailable';
$result = $this->db->query($query);
return $result->result_object();
}
I'm running these from my controller like so:
Code:
function index() {
$data['dates'] = $this->week->get();
$data['unavailable'] = $this->to_array($this->week->unavailable_weeks(), 'id', 'week');
$this->render('index', 'Välj veckor', $data);
}
$this->render and $this->to_array are custom functions but this is just to show the calls to the model.
Does anyone know how to solve this?
Regards,
Niklas[/b]