title: MySQL dump on WAMP server using PHP
body: <p>I am trying to dump the mysql database using a PHP file.
  I am using windows 7 OS.</p>
  
  <p>but I am always getting error;
  This is my code</p>
  
  <pre><code>$user='root';
  $pass='mypassword';
  $host='localhost';
  //$sql_file='db_backup.sql';
  $cmd = "e:\\wamp\\bin\\mysql\\mysql5.6.12\\bin\\mysqldump -h$host  -u$user -p$pass hospitalerp &gt; db_backup.sql";
  exec($cmd, $output, $return);
  if ($return != 0) { //0 is ok
      die('Error: ' . implode("\r\n", $output));
  }
  
  echo "dump complete";
  </code></pre>
  
  <p>Any suggestion will be greatly appreciated.
  Thanks.</p>