A: 

The backslash is in most environments an escape character. You've basically two solutions:

  1. Use double backslash \\ to represent a single backslash.
  2. Use forward slashes / instead (works perfectly in all platforms, including Windows and *NIX).

I would prefer solution 2 as it works everywhere and would minimize developer confusion.

BalusC
I am using `\\\` in my code right?
JPro
I couldn't understand your suggestion for / ?
JPro
Instead of `\\fil01\logs\Test\Dat1\oop_s\2010\Log`, you could have it `fil01/logs/Test/Dat1/oop_s/2010/Log`
Anthony Forloney
@JPro: no, you are using it to escape \ in PHP code itself. You need to escape it once more for MySQL, so your PHP string should look like `foo\\\\bar\\\\waa`. Optionally you can also configure the environment so that it doesn't eat them (as you found out with `NO_BACKSLASH_ESCAPES`). With my suggestion for forward slahes I just **literally** mean to use them **instead of** backslashes. Replace them by forward slashes. `foo/bar/waa`. That's all. It works in all platforms and you don't need to hassle with environmental behaviours and configs wrt backslashes which may make your code unportable.
BalusC
A: 

I got it resolved. The only setting I had to make was this :

$set = mysql_query("set sql_mode='NO_BACKSLASH_ESCAPES';");

before updating.

Hope this helps others.

JPro