Jump to content

Archived

This topic is now archived and is closed to further replies.

may

Mysql not saving slashes

Recommended Posts


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);

Share this post


Link to post
Share on other sites
Use addslashes on the uploadfile variable:
[code=php:0]$sql2="update adverts set login='" . addslashes($uploadfile) . "'";[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.