Create/modify a MySQL query
£10-20 GBP
Paid on delivery
I recently migrated from PHPBB forum software to MyBB software, but when the conversion finished I was left with lots of weird characters in many posts, such as <P>, </e> , etc.
I used the below query to remove things like this, and it has worked well and removed lots of these characters:
UPDATE mybb_posts SET message = REPLACE (message, '<P>', '') WHERE message LIKE '%<P>%';
My problem now is that the stuff I need to remove varies from post to post - here's a few examples:
">[login to view URL] ... Sw7k9eIFHa</a><!-- m -->
">[login to view URL] ... x?TypeID=F</a><!-- m -->
">[login to view URL] ... gKQjPD_BwE</a><!-- m -->
As you can see, each line that I need to remove starts and ends with the same group of characters. I modified the above query using the % as the wildcard, so the query became:
UPDATE mybb_posts SET message = REPLACE (message, '">htt%m -->', '') WHERE message LIKE '%">htt%m -->'%';
When I click "Simulate Query" I get a message saying 1643 rows affected, but when I click "Go" to run the query it comes back and tells me 0 rows affected.
I need someone to tell me what's wrong with my query or suggest another query to achieve the same outcome.
Project ID: #25900033
About the project
Awarded to:
Hi, I know what's wrong with your query and I can help you to fix that query. Please contact me and let's discuss more about this. Thanks.
5 freelancers are bidding on average £13 for this job
Hi, Your posting is very interesting. I have 8 years of experience in web development field. I have worked on several projects with php, mysql and can deliver quality result to tight deadlines. Looking forward to conne More
I tried your sql query. Yes, it works, but 0 rows affected. I think there is a problem in REPLACE function. What do you want as result of your query exactly? Can I help you?