Jump to content

MySQL Replace does not replace text Help


lordshoa

Recommended Posts

Having trouble replacing text in a field, mysql does it stuff but does not change the text but says successful ?

 

SELECT Replace( `fulldescr`,'This overview section','The description section') 
FROM `details` WHERE `id` = '14514' LIMIT 1

 

Any help would be great

Thanks

Link to comment
Share on other sites

I am trying to replace the text with diffarent text, but there is more text in the row field  that I want to keep as each row is diffarent.

 

I used code below to change text in a field before and worked perfectly well with SELECT 

SELECT Replace(image_path , '..', '.') FROM `images`

Link to comment
Share on other sites

A SELECT query doesn't change anything in the table. It would be used if you want to display the data differently than the way it's stored. If you want to actually change the data in the table, you would need to run an UPDATE query.

Link to comment
Share on other sites

thanks

 

Do not know why I had the wrong query as my working example for myself.

 

UPDATE `details` SET fulldescr = replace(`fulldescr`, 'This overview section', 'The product description section') WHERE `id`='14514' LIMIT 1

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.