may Posted August 23, 2006 Share Posted August 23, 2006 I have this strange problem of saving file name. I want to save the path of the file just uploaded. The variable $uploadfile contains the whole path for the file as :$uploadfile='E:\mydata\pop.jpg';The problem is that my query written below does not save the '\' , even if i use addslashes it completely ignores it. any idea how can i save slashes in mysql?$sql2="update adverts set login='$uploadfile'";$rs2=mysql_query($sql2); Link to comment https://forums.phpfreaks.com/topic/18480-mysql-not-saving-slashes/ Share on other sites More sharing options...
wildteen88 Posted August 23, 2006 Share Posted August 23, 2006 Use addslashes on the uploadfile variable:[code=php:0]$sql2="update adverts set login='" . addslashes($uploadfile) . "'";[/code] Link to comment https://forums.phpfreaks.com/topic/18480-mysql-not-saving-slashes/#findComment-79556 Share on other sites More sharing options...
may Posted August 25, 2006 Author Share Posted August 25, 2006 Thanks wildteen! This code worked :) Link to comment https://forums.phpfreaks.com/topic/18480-mysql-not-saving-slashes/#findComment-80224 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.