title: PHP: multiple SQL queries in one mysql_query statement
body: <p>So I have an SQL dump file that needs to be loaded using mysql_query(). Unfortunately, it's not possible to execute multiple queries with it.</p>
  
  <p>-> It cannot be assumed that the <strong>mysql command-line client</strong> (mysql --help) is installed -- for loading the SQL file directly</p>
  
  <p>-> It cannot be assumed that the <strong>mysqli</strong> extension is installed</p>
  
  <pre><code>/* contents of dump.sql, including comments */
  DELETE FROM t3 WHERE body = 'some text; with semicolons; scattered; throughout';
  DELETE FROM t2 WHERE name = 'hello';
  DELETE FROM t1 WHERE id = 1;
  </code></pre>
  
  <p>The explode() below won't work because some of the dump content's values contain semicolons.</p>
  
  <pre><code>$sql = explode(';', file_get_contents('dump.sql'));
  foreach ($sql as $key =&gt; $val) {
      mysql_query($val);
  }
  </code></pre>
  
  <p>What's the best way to load the SQL without modifying the dump file?</p>