Log in

View Full Version : MySQL LIKE, small problem with returned html data



jamiller
03-25-2008, 05:26 PM
I am working on a small and simple website search that uses the MySQL "LIKE" statement to return data. However, the data I'm searching also contains some html so if you search for "div" you will get a lot of results but because the html is interpreted by the browser, you will never find the string "div." in the results.

So is there a way to somehow tell MySQL to query the database and return the results that don't match a predefined set of characters (html)? Or maybe a different way of displaying the data with PHP will solve the problem.

I'm using MySQL 5.0.45 and PHP 5.2.4

boogyman
03-25-2008, 08:26 PM
SELECT fields FROM table(s) WHERE property NOT LIKE value

jamiller
03-26-2008, 12:51 PM
Ha! Should have known. Thanks Boogy, you're always there to help me out!