How to Replace [Size= in mysql ?

Yodrak

in memoriam 1976 - 2020
Hello, i need help in mysql query.
I would like to replace the

Code:
[Size=1]
[Size=2]
[Size=3]

to

Code:
[Size=4]

From all Fonts in table xf_post between specific Timestamp Dezember 23 2004 and March 03 2016.
I need to use the column post_date but don´t know how to do that.

Anyone who can help me please?
 
Last edited:
@Yugensoft i tried this from my thinkink. But it´s not working. :(

Code:
UPDATE message
SET str = REPLACE(str,,[SIZE=1]','[Size=4]') WHERE
Timestamp <= 1415463675 AND str LIKE %[SIZE=1]%'
 
@AndyB Thank you, but that will replace the Size of Fonts in all Posts. The Problem is we migrate from vB4 to Xenforo in March 16. So i would need
a query with Timestamp until March 03 2016.
 
Then the Font Size will be to big from March 2016 on. My guess is that the Fonts got wrong converted by the Import from vB. As i can remember in vB the most used Fontsize was 12 points.
 
Then the Font Size will be to big from March 2016 on

That should not be the case. The font size would be the same for all the posts and can be adjusted in the style properties, but you should not have to do that.
 
@AndyB i think we did cross talk but thank you for trying to help me. I know that a BB-Code Size=1 will be everywhere the same. But the Properties Settings before in vB4 was different to the Settings in xenforo i guess. In the past 1.5 years we got 150000 Posts more so i searched a way to make changes in a given Timespace.

In the meanwhile i found the solution with the help of a friend.

Code:
UPDATE xf_post
SET message= REPLACE(message, "[SIZE=1]", "[SIZE=4]")
WHERE post_date >= UNIX_TIMESTAMP("2004-04-04") AND post_date <= UNIX_TIMESTAMP("2016-03-08")
    AND message LIKE "%[SIZE=4]%"
 
Back
Top Bottom