title: How can I insert a lot of data into mySQL database at once?
body: <p>I insert data from a text file into mySQL database and there will be inserted around 6000 or more entries at once.</p>
  
  <pre><code>try {
     $sql = "INSERT INTO data (id,name,date,place) values(?,?,?,?) ";
     $q = $pdo-&gt;prepare($sql);
     foreach($data as $row) {
        $q-&gt;execute(array($row['id'], $row['name'], $row['date'], $row['place']));
     }
  }
  catch (PDOException $pe) {
     echo $pe-&gt;getMessage();
  }
  catch (Exception $e ) {
     echo $e-&gt;getMessage();
  }
  </code></pre>
  
  <p>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.</p>
  
  <p>What could cause this problem and how can I solve it?</p>