I have a script that is printing output before MySQL has finished. How is this possible? In this example, the script echos immediately while MySQL hasn't finished. I can watch the updates in phpmyadmin which take about 2 minutes.
try {
$dbl->beginTransaction();
$sql = $dbl->prepare($update);
foreach($batchUpdate as $c => $i) {
foreach($i as $key => $val) {
$sql->bindValue(":$key$c", $val);
}
}
$sql->execute();
$dbl->commit();
} catch (Exception $e) {
die('Error:'.$e);
}
echo 'output '.time();
S