title: How to back up MySQL table into a dump with PHP?
body: <p>Is there any way to dump whole database using php <strong>but not to CSV or XML</strong> because I need it in pure SQL format.</p>
  
  <p>Example of dump I need:</p>
  
  <pre><code>CREATE TABLE 'table_name' etc..;
  INSERT INTO 'table_name' (field, field2) VALUES ('1','2');
  INSERT INTO 'table_name' (field, field2) VALUES ('1','2');
  </code></pre>
  
  <p>I don't have usage of <strong>exec()</strong> or <strong>system().</strong>
  And without manually creating an INSERT statement.. 
  Example:</p>
  
  <pre><code>while($row = mysql_results) {
   $sql_dump = 'INSERT INTO ...';
  }
  </code></pre>
  
  <p>Thank you! :)</p>