I am trying to run the following php script
$maxmonth = date('m');
$maxyear = date('Y');
$sql = "SET @cmonth = 1;
SET @cyear = 2015;
SET @maxmonth = ".$maxmonth.";
SET @maxyear = ".$maxyear.";
CALL insertBills(@cyear,@cmonth,@maxyear,@maxmonth);";
multiQuery($sql);
$sql = "SET @cfmonth = 1;
SET @cfyear = 2015;
SET @maxfmonth = ".$maxmonth.";
SET @maxfyear = ".$maxyear.";
CALL insertFees(@cfyear,@cfmonth,@maxfyear,@maxfmonth);";
multiQuery($sql);
The problem is the only one of them runs at a time. If I disable the first one, the second one works however both are not executed in one page refresh.
function multiQuery($sql) {
global $dbi_connection;
$dbi_result = mysqli_multi_query($dbi_connection,$sql);
return $dbi_result;
}