Use of UPDATE & SELECT operators

Hi - I'm sure this has been asked before but I've tried looking!

It's been 20 years since I last used SQL (DB2 and an IBM Mainframe), but all I'm trying to do is change a string of text within a cell.

Background - I'm just changing URL address on a wordpress related DB.

So in MYSQL it's UPDATE wp_posts SET post_content = replace(post_content, 'http://www.example.com', 'http://localhost/test-site');

Using MariaDB syntax I've tried: UPDATE `wp_posts` SET `post_content`= REPLACE (`post_content`,'http://www.holidaycottagesloirevalley.com','http://localhost/hclv'); and after some reading I've tried REPLACE INTO `wp_posts` VALUE ('http://www.holidaycottagesloirevalley.com','http://localhost/hclv');

No joy and I've run out of ideas (strength!)

Can anyone point me in the right direction please?

Thanks in advance,

Jon.

Answer Answered by Jon Lethbridge in this comment.

Hi - Thanks for the reponse.

When simulating the querey I was getting the following...

  1. 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1

However, with you confirming the SQL I actually ran the SQL and it worked fine. So it must be an issue with the simulator running within XAMPP which is what I am using for my local environments.

So I think I'm sorted - although a little confused.

Thanks for your quick response.

Jon.

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.