开发者

A tiny edit to Mysql query to edit some links in my database

开发者 https://www.devze.com 2023-02-22 13:52 出处:网络
Hello I want to remove all the http://www.domain.com/?h from my mySQL database. ( the \'h\' is because I have some posts that starts with ?p and I dont want to edit them ) and replace them with my new

Hello I want to remove all the http://www.domain.com/?h from my mySQL database. ( the 'h' is because I have some posts that starts with ?p and I dont want to edit them ) and replace them with my new domain. The structure of my database is like below and the SQL query I have returns me an error. How can I fix that?

TABLE: wp_posmeta

meta_key : _tdomf开发者_如何学JAVA_custom_permalink

meta_value : http://www.domain.com/?http://theirdomain.blogspot.com/..../.../...html

UPDATE wp_postmeta set _tdomf_custom_permalink = replace(_tdomf_custom_permalink, 'http://www.domain.com/?h', 'http://www.newdomain.com') WHERE _tdomf_custom_permalink like 'http://www.domain.com/?h%'

And the error I get is : Unknown column '_tdomf_custom_permalink' in 'where clause'

Thank you!


replace all _tdomf_custom_permalink with meta_value? :)


There's no column in that table called "_tdomf_custom_permalink", that should be a value on a row in the column "meta_value"

so that becomes

UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, 'http://theDomainYouHaveNow.com', 'http://theDomainYourWantAfterUpdate.com') WHERE meta_key = '_tdomf_custom_permalink'

0

精彩评论

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