Problems with update mysql

Asked

Viewed 258 times

1

I have a field from a table that saves the path to a locally stored file. When I run the following command:

UPDATE tabela1 set caminho = 'c:\logs\caminho.txt' where cod_tab = 1

it saves without the backslash. Therefore, it saves as follows:

c:log.txt

Does anyone have a hint of what might be happening? The path is typed in simple quotes (string).

Note: MYSQL (PHPMYADMIN)

1 answer

2


That’s because it has to make the escape from \, when you want to insert backslashes. Do:

UPDATE tabela1 set caminho = 'c:\\logs\\caminho.txt' where cod_tab = 1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.