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); Quote Link to comment 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] Quote Link to comment Share on other sites More sharing options...
may Posted August 25, 2006 Author Share Posted August 25, 2006 Thanks wildteen! This code worked :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.