tags:

views:

31

answers:

2

I have a table for articles. Its major fields are id article_name content tags (its values will be comma seperate example test, abc ...)

Now when I am on a detail page of any article. I want to show related article in my sidebar. For this if any other article uses the same tag as current article. I want to list those articles as related article. This is my query.

Can anyone please help me on this issue. I want to solve this with minimal coding. Your help will be very much appreciated.

Thanks

A: 

select.....

where find_in_set(current article name,name of column)

try this

Richa
A: 

For minimum coding you can use FIND_IN_SET function.

 SELECT FIND_IN_SET('b','a,b,c,d');

But next time consider using an additional table to store each tag in separate record

Naktibalda