MySQL Forums
Forum List  »  Newbie

Re: Batch edit a table using sql
Posted by: Peter Brawley
Date: August 13, 2014 08:43PM

> Not sure I understand your insert and replace cmds

See the docs for those two functions at http://dev.mysql.com/doc/refman/5.6/en/string-functions

> what would I put in my query to add the shortcode to the end of the content in all my posts for the "where" clause?

"for the where clause"? What does that mean?

To append the string '[caption]New Caption[/caption]' to all values of wp_post.post_content, write ...

UPDATE wp_posts SET post_content = Concat( post_content, '[caption]New Caption[/caption]' );

See the manual page for Concat().

Options: ReplyQuote


Subject
Written By
Posted
August 13, 2014 12:46PM
Re: Batch edit a table using sql
August 13, 2014 08:43PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.