How to search within a list of comma separated strings in single column in mysql

If You have a field arr_val (varchar(50)) in a your table tst_tbl that contains a comma delimited string such as PHP,MySql,Ajax,JQuery,PHP 5.

When running the query select * from arr_val where arr_val like ‘%PHP%’ to get all the only PHP Results ( not PHP 5) , But you will also get the result PHP 5.

Now the Question is “How should we rewrite the query so that is selects ONLY the PHP and not all values containing PHP ? Continue Reading