How to show related content using like in mysql?

Posted by halocursed on Stack Overflow See other posts from Stack Overflow or by halocursed
Published on 2010-02-02T08:25:55Z Indexed on 2010/05/29 18:02 UTC
Read the original article Hit count: 182

Filed under:
|

I currently have a table for products with it's own set of tags and a table for news with it's own set of tags. I wanted to add related news to the products page so I was thinking of using like but since the column tags in the products page is something like

(Products) tags- manutd, man utd, football
(news) tags - manutd, blah, bruha [this one is related]
(news) tags - man, utd, bruha [this one is not related]

I wanted to use a query to show all news containing any of the tags(from products) seperated by commas using mysql. How should I go about constructing such a query?
If there is a better way of doing this a little explanation would be helpful too. Thanks

© Stack Overflow or respective owner

Related posts about mysql

Related posts about tags