title: how to escape single and double quotes in mysql backup(.sql file) that is taken using mysqldump
body: <p>I want to take daily backup of my DB for that I use following code</p>
  
  <pre><code>$username =escapeshellcmd($dbuser);
  $password =escapeshellcmd($dbpwd);
  $hostname =escapeshellcmd($server);
  $database =escapeshellcmd($dbname);
  
  $backupFile='/mypath/dbBackup/'.date("Y-m-d-H-i-s").'.sql';
  $command = "mysqldump -u$username -p$password -h$hostname $database &gt; $backupFile";
  system($command, $result);
  </code></pre>
  
  <p>I place this code in php file and call that file through cron job that I set to take daily DB backup. This works fine but problem is my column in table contains content that have number of single and double quotes. Because of this when backup file is created (.SQL file) it contains broken INSERT query like this</p>
  
  <pre><code>INSERT INTO `mytable` VALUES (1,'don\'t read this article','test\'ssdf','',1,5,6,0),(2,'goal setting tips you\'d want to try','Category- ' ....
  </code></pre>
  
  <p>So is there any way to escape these single and double quotes in .SQL backup file while using mysqldump.</p>