PDA

View Full Version : sql query remove links


Danielgsc
07-01-2011, 10:44 PM
First of all, sorry my english.
Well, I would like to do a sql query to remove all the links in a subforum (id=xx).
Like this
update post,thread
set post.pagetext= replace(post.pagetext,'http://www.*************')
where post.threadid=thread.postid
and thread.forumid=xx

But instead of http://www.**********
What syntaxis (Regular expressions, I supose) must I use to say that it should remove all the words, signs... that exists between and ?

Thanks in advance.

vbresults
07-02-2011, 12:57 PM
I don't think MySQL supports regex replacements. You will have to select with a regex and process them in a script individually, performing the full operation there.