title: Empty files generated from running `mysqldump` using PHP
body: <p>I keep getting empty files generated from running</p>
  
  <pre><code>$command = 'mysqldump --opt -h localhost -u username -p \'password\' dbname &gt; \'backup 2009-04-15 09-57-13.sql\'';
  
  command($command);
  </code></pre>
  
  <p>Anyone know what might be causing this? My password has strange characters in it, but works fine with connecting to the db.</p>
  
  <p>I've ran <code>exec($command, $return)</code> and outputted the $return array and it is finding the command. I've also ran it with <code>mysqldump &gt; file.sql</code> and the file contains </p>
  
  <pre><code>Usage: mysqldump [OPTIONS] database [tables]
  OR     mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
  OR     mysqldump [OPTIONS] --all-databases [OPTIONS]
  For more options, use mysqldump --help
  </code></pre>
  
  <p>So it would seem like the command is working.</p>