my model has two methods call two different stored procedures:
PHP Code:
function call_1($parameter)
{
$sql = "CALL my_procedure_1(?);";
$paras = array($parameter);
$query = $this->db->query($sql, $paras);
$result = $query->getResult();
$query->free_result();
return $result;
}
function call_2($parameter)
{
$sql = "CALL my_procedure_2(?);";
$paras = array($parameter);
$query = $this->db->query($sql, $paras);
$result = $query->getResult();
$query->free_result();
return $result;
}
In my controller, I call two methods in order.
PHP Code:
$this->db->call_1($parameter);
$this->db->call_2($parameter);
However, only the first call was successful. The second call stops the php execution.
Could anyone please tell me how to solve it?
I used CodeIgniter 4, and there is no problem with my stored procedures script.