I know this must be very simple, but I cannot make this work - I am trying to store a simple file path in a MySQL database from my PHP web page. But the backslashes get lost when I write the update statement (it's an existing record).
$sPath = "c:\\mypath\myfile.jpg";
$sSQL = "UPDATE mytable SET filepath='" . $sPath . "' WHERE id = 9";
I end up with a filepath that is c:mypathmyfile.jpg
If I first call addslashes($sPath) then I end up with double the slashes in the database.
Can someone help this poor soul? :)