I insert data from a text file into mySQL database and there will be inserted around 6000 or more entries at once.
try {
$sql = "INSERT INTO data (id,name,date,place) values(?,?,?,?) ";
$q = $pdo->prepare($sql);
foreach($data as $row) {
$q->execute(array($row['id'], $row['name'], $row['date'], $row['place']));
}
}
catch (PDOException $pe) {
echo $pe->getMessage();
}
catch (Exception $e ) {
echo $e->getMessage();
}
I tried it with 3000 entries and everything works fine. But if I have more data to be inserted it happens that my page is blank and nothing is inserted into my database.
What could cause this problem and how can I solve it?