更新wp-post表列字符串部分

时间:2017-06-17 10:28:37

标签: php mysql wordpress

我在wordpress数据库的wp-post表中有以下数据,需要将http条目更新为https。我尝试过以下查询,但它并没有影响它。

UPDATE CwwNResoposts
SET   post_content = ( Replace (post_content, 'href="https:', 'href="http:') )

列条目:

This is an example page. It's different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:

<blockquote>Hi there! I'm a bike messenger by day, aspiring actor by night, and this is my website. I live in Los Angeles, have a great dog named Jack, and I like pi&#241;a coladas. (And gettin' caught in the rain.)</blockquote>

...or something like this:

<blockquote>The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.</blockquote>

As a new WordPress user, you should go to <a href="http://veezphone.com/wp-admin/">your dashboard</a> to delete this page and create new pages for your content. Have fun!

1 个答案:

答案 0 :(得分:0)

您需要交换替换查询

UPDATE CwwNResoposts
SET   post_content = ( Replace (post_content, 'href="http:', 'href="https:') );

检查替换查询格式:REPLACE(str, find_string, replace_with)