Davina Davina - 3 months ago 32
MySQL Question

Delete some characters from mysql row

I need to delete

~\NewFolder1\
from the field
photo
in my table
new
but the query doesn't work

UPDATE `new` SET `photo`=REPLACE(`photo`,'~\New\','')

Answer

You need escape '\' by adding additional '\'

UPDATE `new` SET `photo`=REPLACE(`photo`,'~\\NewFolder\\','')