Connecting Tech Pros Worldwide Help | Site Map

Saving A Windows File Path

xtianixm's Avatar
Member
 
Join Date: Jul 2007
Posts: 52
#1: Aug 28 '07
hola everyone,

how can i save a file path into mysql database without removing the '\'

im using XAMPP for my database or phpmyadmin then when i try to insert a file path (ex. D:wallpaper\me.jpg) it removes the backslash and now it became
D:wallpaperme.jpg ..when i try load it an error occur "file not found" because the backslash was remove!

..help!
docdiesel's Avatar
Moderator
 
Join Date: Aug 2007
Location: Munich
Posts: 289
#2: Aug 28 '07

re: Saving A Windows File Path


Hi,

this doesn't sound like a MySQL problem to me. I guess it's a topic related to your programming language, like you have to escape the "\" by a double one, "\\".

Providing more information could definitely help. Are you using Perl or PHP? Please post at least that part of your code that's relevant to this problem.

Regards, Bernd
mwasif's Avatar
Moderator
 
Join Date: Jul 2006
Location: Pakistan
Posts: 718
#3: Aug 28 '07

re: Saving A Windows File Path


Use addslashes() if you are using PHP to insert the data in DB.
Reply