The sql command modifies the key value specified in the log_Meta field of the zblog article zbp_post data table in batches

What is the use of this method?

That is, our zblog website, after changing the theme, wants to call the content of the old theme log_Meta field in the new theme, but the key names of the new theme and the old theme are different.

For example, if you use a product theme, the price key for the new theme is price (the call variable is: $article->Metas->price), and the price key for the old theme is jiage (the call variable is: $article->Metas->jiage).
We want to change jiage to price, so how to modify it in batches?

SQL commandas follows

UPDATE zbp_post
SET log_Meta = REPLACE(log_Meta, 's:5:"jiage";', 's:5:"price";');

Please note that the length of the characters cannot be wrong!

If the original price key name is also included, the original price key name of the new theme is oldprice, and the original price key name of the old theme is yuanjia. Combined with the order to replace the price, how should we execute it?

The sql command is as follows

UPDATE zbp_post
SET log_Meta = REPLACE(REPLACE(log_Meta, 's:5:"jiage";', 's:5:"price";'), 's:7:"yuanjia";', 's:8:"oldprice";');

Finally, you have to execute the sql command in phpmyadmin

image.png

t like1

Link to this article:https://en.finchui.com/zblog-course/86.html

netizens commented

guess you like

hot commodity
popular articles
hot Tags
related tags
FinchUI Store Edition Hong Kong Special Area

share

copy Link

Xinglan Studioadd friends

Working hours: 9:00-22:00
Saturday and Sunday: 14:00-22:00
wechat
Scan the code to add customer service WeChat