Davina Davina - 11 months ago 71
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 Source

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

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