Davina Davina - 1 year ago 99
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\\','')
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download