I have one query which prints all articles assigned to current article’s category
SELECT * FROM #__content WHERE catid='$catid'
And in this table(below) there are articles which are assigned to current article as similar articles
assigned_id fav_id
1 45
1 12
1 53
SELECT fav_id FROM #__similar WHERE id='$id'
I want them to be hidden in first query, which is outputing all articles including one which are assigned as similar. So in this example articles with id 45,12,53 would be excluded
Full query:
As you can see, query joins __content with __similar thourh fav_id, that means, query is looking if this content is similar to som other content. In last join I chech that the similar item is in the same category.