storing paths in msyql database

I moved my program from my linux machine to my vista machine… and noticed some problems. When I store a file / directory path from the Linux machine into a Mysql database field it works fine… but when I attempt to do so from windows, it takes all of the \ characters out of the text.

I realize this is a mysql behavior not Xojo, but how do you go about converting the folderitem.absolutepath string into something that MySql will not corrupt?

Hi, I’m not into MySQL, but how about:

#if TargetWin32 then
filestring = replaceall(folderitem.absolutepath,"","/")
#else
filestring = folderitem.absolutepath
#Endif

most likely because “” is an escaping character

and don’t use ABSOLUTEPATH… use NATIVEPATH

You need to be using prepared statements. You can have all kinds of bad things happen if you don’t.

http://documentation.xojo.com/index.php/MySQLPreparedStatement