Jump to content

How to change content value ?


Germaris

Recommended Posts

Hi there !

I'm quite desperate as I can't find a quick method to partially change the content of a field.

I explain:
In a field named 'notes', PART of the content is:
[code]<a href='mailto:"[email protected]"'>[email protected]</a>[/code]
This content is wrong.

It must be:
[code]<a href="mailto:[email protected]">[email protected]</a>[/code]

How can I make the change with a SQL Query instead of manually make the change row by row (approximately 1500 rows contain the error!!!) considering the fact that [email protected] is different in each of the rows?

Many thanks in advance for any help!

Best regards,

Gerard
Link to comment
https://forums.phpfreaks.com/topic/27026-how-to-change-content-value/
Share on other sites

Not easily, really... REGEXP is useful for matching these rows, but you can't use Perl-style regexs to replace, AFAIK.  However, you can use a combination of LOCATE() and REPLACE(), since you can probably make some simplifying assumption about the location of these extra quotes.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.