1

I've a SQL table containing HTML coded and formated text from a TinyMCE textarea field.

I want to give the frontend user of my PHP project the possibility to search for a record containing a special word.

If I use a clause like WHERE description LIKE '%<word>%', the results (logicaly) also contains records with the word in the HTML code, not only in the readable text.

How I can search only the readable text in a field which contains HTML code?

Is there a function to filter out all unreadable code?

G.L.P
  • 7,051
  • 4
  • 22
  • 40
mikexmagic
  • 65
  • 6
  • You can apply a `X_REG_REPLACE` on the column before you do the `LIKE`, this will probably perform very poorly though ;) – Halcyon Sep 14 '15 at 12:47
  • Please refer following links http://stackoverflow.com/questions/18040097/mysql-extract-plaintext-from-html-data-or-php http://stackoverflow.com/questions/7654436/what-is-the-mysql-query-equivalent-of-php-strip-tags – dhi_m Oct 09 '15 at 10:51

0 Answers0