the only better way of doing it is to normalize the table
any time you store multiple values inside a single column, you are asking for exactly this type of trouble (it violates first normal form, in case you want to do some research)
it's okay to store it that way, if you only ever retrieve it by table key, but if you try to search inside that column, you get this nasty ****-up
for one thing, it doesn't scale, because it requires a table scan, so the more rows in the tables, the slower the search
here's a more compact form of the WHERE condition...
Code:
WHERE CONCAT(',' , property_type , ',') LIKE '%,2,%'
helps?
Bookmarks