First of all i explain my working environment. I m using Windows 7, CodeIgniter 3.0.2, PHP 5.2.0 and MySQL 5.5
. I facing difficulty while call 2 different procedure one after another. From the first procedure I am getting room availability and based on that i am calling another procedure. The 1st procedure is running fine but while calling 2nd procedure it is showing error as :
Commands out of sync; you can't run this command now
CALL ConfirmRoom('40331411072018', 5,3, '2018-07-02', '2018-07-04', '27062018I10023',1)
i mention the code below:
//1st Procedure
$sql = $this->db->query("CALL CheckAvailbility(GuestHouse,RoomType,'StayDate','StayOutDate',room)");
if($sql->num_rows()>0) {
$row = $sql->first_row();
if($row->avail='Y') {
//2nd Procedure
$sql = $this->db->query("CALL ConfirmRoom('BookingId', GuestHouse,RoomType, 'StayDate', 'StayOutDate', 'GuestID',noroom)");
if($sql->num_rows()>0) {
//statement
}
}
}
else {
//statement
}