2

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

Caleb Pitman
  • 1,105
  • 1
  • 12
  • 24
  • See marked answer, it might be relevant: http://stackoverflow.com/questions/6102968/php-mysqli-multi-query-asynchronous – Zentoaku Aug 08 '14 at 14:50

0 Answers0