title: How to insert a file path into a MySQL table using php?
body: <p>I'm trying to insert a file path into an empty MySQL table with PHP 5 but slashes and other characters are removed so I can not use to the string when calling it from the table. What function do I use to preserve the file path without losing characters?</p>
  
  <pre><code>$rawpath    = "F:\Business\test.htm";
  $url        = "Business";
  
  $query      = "INSERT IGNORE INTO `sites` (`url`,`base`)".
                "VALUES ('$rawpath','$url');";
  echo $query;
  </code></pre>
  
  <p>Outputs:  INSERT IGNORE INTO <code>sites</code> (<code>url</code>,<code>base</code>) VALUES ('F:\Business\test.htm','Business');</p>
  
  <pre><code>$query      = "SELECT * FROM `sites` WHERE `base`='Business';";
  $row        = mysql_query($query);
  $url        = mysql_result($row,0,"url");
  
  echo $url;
  </code></pre>
  
  <p>Outputs: F:Businesstest.htm</p>