hi!

I have a table which contain files paths.
my problem is, that when I insert a path, MySQL omit the separator char.

for example:
INSERT INTO A VALUES ('C:\qqq\www\eee.ttt');

will be saved in A as: C:qqqwwweee.ttt

what can I do for saving the path as it is?

(ofcourse, I mean solution withou duplicating the '\',)

I have to say, that there is another problem, for example c:\nate. mysql turn the \n to new line...

Thanks,
Nate

what you can do is this;

INSERT INTO a VALUES ('C:\\qqq\\www\\eee.ttt');

The first slash tells the MySQL engine that the next character is to be taken as a literal character as opposed to a character which MySQL has reserved.


The second problem can be solved with the same solution.

INSERT INTO a VALUES ('C:\\nate');

what you can do is this;

INSERT INTO a VALUES ('C:\\qqq\\www\\eee.ttt');

The first slash tells the MySQL engine that the next character is to be taken as a literal character as opposed to a character which MySQL has reserved.


The second problem can be solved with the same solution.

INSERT INTO a VALUES ('C:\\nate');

knew that... as I already wrote, I wanna know if there is any other solution.

Thanks anyway...
-Nate

OH sorry, no this is it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.