I am struggling to find a solution to this. I have tags that are inserted into the database in this form
mytags=firsttag, secondtag, thirdtag
On the single page I need to show related items based on these tags aso I am using
SELECT * FROM posts WHERE tags LIKE \"%$mytags%\" ORDER BY views DESC LIMIT 5"
However this doesn't work much as it only searches for posts that have the exact same tagline (firsttag, secondtag, thirdtag) and not the posts that their tag contain one of the tags (firsttag, anothertag, andanothertag).
I thought of exploding mytags and then search using the first tag in the array, but this doesn't work very good.
Does anyone know an effective method of searching?