title: Restore mysql database using php
body: <p>I'm trying to restore MySQL dump created the following way:</p>
  
  <pre><code>require_once 'mysql_restore.class.php';
  $restore_obj = new MySQL_Restore();
  
  $restore_obj-&gt;server = 'localhost';
  $restore_obj-&gt;username = 'root';
  $restore_obj-&gt;password = '';
  $restore_obj-&gt;database = 'database';
  if (!$restore_obj-&gt;Execute(MSR_FILE, 'bk.sql.gz', true, false))
  {
    die($restore_obj-&gt;error);
  }
  </code></pre>
  
  <p>but its showing an error</p>
  
  <p><strong>Warning: gzuncompress() [function.gzuncompress]: data error in C:\wamp\www\nidhin\mysql_restore.class.php on line 42
  Warning: Invalid argument supplied for foreach() in C:\wamp\www\nidhin\mysql_restore.class.php on line 215</strong></p>
  
  <p>Any idea what I'm doing wrong? </p>