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?
$rawpath = "F:\Business\test.htm";
$url = "Business";
$query = "INSERT IGNORE INTO `sites` (`url`,`base`)".
"VALUES ('$rawpath','$url');";
echo $query;
Outputs: INSERT IGNORE INTO sites
(url
,base
) VALUES ('F:\Business\test.htm','Business');
$query = "SELECT * FROM `sites` WHERE `base`='Business';";
$row = mysql_query($query);
$url = mysql_result($row,0,"url");
echo $url;
Outputs: F:Businesstest.htm