MyBB Community Forums
Vb4.25 merge to 1822 - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: Merge System Support (https://community.mybb.com/forum-180.html)
+--- Thread: Vb4.25 merge to 1822 (/thread-226210.html)



Vb4.25 merge to 1822 - Seeker-Smith - 2020-01-25

After doing a merge none of the youtube video links work. Here is why. The top is VB.

video=youtube;osHhWnSP5Gc]https://www.youtube.com/watch?v=osHhWnSP5Gc[/video]

video=youtube]https://www.youtube.com/watch?v=osHhWnSP5Gc[/video]

One the great folks here supplied me this but it does not work with msql 5.7
update mybb_posts set message=regexp_replace(message, 'video=youtube;[^\]]+]', 'video=youtube]')

If someone can help me do a search and replace with phpMyAdmin, I'd love to buy a coffee.

Also future users may find this helpful in merges.


RE: Vb4.25 merge to 1822 - .m. - 2020-01-26

above given query should work !

anyway, you can try using REPLACE instead of regexp_replace like below
UPDATE `mybb_posts` SET `message` = REPLACE (`message`, 'video=youtube;[^\]]+]', 'video=youtube]') WHERE `message` LIKE '%video=youtube%' 

Edit: are you referring to MSSQL [microsoft sql] ? [see replace query]


RE: Vb4.25 merge to 1822 - Seeker-Smith - 2020-01-26

Hi and thanks for the reply. It's MySQL 5.7 and I'm using phpMyAdmin to run the query. It gives me an error on line 4.

UPDATE
    `mybb_posts`
SET
    `message` =
REPLACE
    (
        `message`,
        'video=youtube;[^\]]+]',
        'video=youtube]'
    )
WHERE
    `message` LIKE '%video=youtube%'