Not Solved Vb4.25 merge to 1822
#1
Not Solved
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.
Reply
#2
Not Solved
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]
Reply
#3
Not Solved
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%'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)