MyBB Community Forums

Full Version: SQL problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to do this (516 results):
SELECT REPLACE(message, '[code]', '') FROM mybb_posts WHERE fid = 64 AND message LIKE '%[code]http%';

but the update doesn't do anything (0 rows affected)
UPDATE mybb_posts SET message = REPLACE(message, '[code]', '') WHERE fid = 64 AND message LIKE '%[code]http%';

What am I doing wrong?
Your second query should work but keep in mind you'll still be left with the [/code] at the end of the link.
Make sure you're using the correct prefix mybb_ according to what you use in you database
I thought is should work as well, but.... it doesn't.

I'll replace the closing tags first, but showed this example to try to discover the error. They seem equal to me, but something must be wrong Sad
I've used PHP - that also allowed me to use a regular expression. So problem solved.