hittade denna. Prestanda i PDO/PHP/MySQL :transaktion kontra direkt exekvering . så prova den här.
$query = $data->prepare("INSERT INTO `tbl_temp` (aid, bid) VALUES (?, ?)");
try {
$data->beginTransaction();
for($i=0; $i < 150; $i++) {
$time = time();
$query->bindValue(1, $i, PDO::PARAM_INT);
$query->bindValue(2, $time, PDO::PARAM_STR);
$query->execute();
}
$data->commit();
} catch(PDOException $e) {
$data->rollBack();
}