Code: Select all
UPDATE phpbb_posts SET post_subject = 'Deleted' WHERE post_text LIKE '%the word%'; UPDATE phpbb_posts SET post_text = 'Deleted' WHERE post_text LIKE '%the word%'
You need be careful with this if the word is not very specific because
%the word%'matches any occurrence, if it were
%man%'that matches gasman, postman, oilman and thecoalman. It would also match manually and "adcmanabc". Whenever I'm doing any type of wildcard search and replace I will add space before an after.
% man %'. That may leave some occurrences like ones on newline or have punctuation afterward but it's not going to wipe out things you do not want to match.