A database table contains many TEXT rows filled with HTML content (for posting articles, blog entries, etc.) What's the best way (or is there a way) to search for a specific term using a MySQL query, while ignoring HTML tags in the data.
Example:
$database_row = "<h1>This is a header</h1> <p>This is a paragraph</p>";
A search for the term 'h1' or even '<h1>' will return this row because the search term happens to be an HTML tag within the data. This is not the desired result.
I'm not positive, but I am under the impression that the results may have to be further parsed by PHP to verify that the rows returned do match after filtering out the HTML. It seems as though there would be some functionality built into the database to accommodate something like this...perhaps something to do with regular expressions.
Any thoughts?