What is the MySQL query equivalent of PHP strip_tags?

后端 未结 9 811
情书的邮戳
情书的邮戳 2020-11-27 18:49

I have a large database which contains records that have tags in them and I would like to remove them. Of course there is the method where I create a

9条回答
  •  执笔经年
    2020-11-27 19:08

    I don't believe there's any efficient way to do this in MySQL alone.

    MySQL does have a REPLACE() function, but it can only replace constant strings, not patterns. You could possibly write a MySQL stored function to search for and replace tags, but at that point you're probably better off writing a PHP script to do the job. It might not be quite as fast, but it will probably be faster to write.

提交回复
热议问题