开发者

How can I replace the value when a specific string is found in SQL

开发者 https://www.devze.com 2023-03-24 07:17 出处:网络
I run a wrong SQL query and now I have to fix some things from the beginning. In my wp_postmeta table there are two fields, meta_value and meta_key.

I run a wrong SQL query and now I have to fix some things from the beginning. In my wp_postmeta table there are two fields, meta_value and meta_key.

How can I replace the existing value of meta_key to _tdomf_custom_permalink o开发者_运维技巧n every row that the string http://www.domain.com/?h is found in meta_value using phpmyadmin SQL.

Secondly, how can I replace the http://www.domain.com/?h (in meta_value field) with another domain ?

Thank you.


Just use update statements in SQL:

update wp_postmeta 
set meta_key = '_tdomf_custom_permalink' 
where meta_value = 'http://www.domain.com/?h'

to then replace the http://www.domain.com/?h:

update wp_postmeta 
set meta_value = 'http://www.yourdomain.com/?h' 
where meta_value = 'http://www.domain.com/?h'
0

精彩评论

暂无评论...
验证码 换一张
取 消