Problem JOINing three tables I want to show all the categories and the items inside that each category which should store in items_this_category.

Note, I have created an associative table item_categories because one item can be listed in more than one category.

Here is a screen of NaviCat with structure and the query
What you need can be achieved via a simple combination of two joins, Let's have a look at a sample query

Select &lt; Fields as per your requirements &gt;
From items i
Inner join item_categories ic On i.item_id=ic.item_id
Right outer join categories c On c.category_id=ic.category_id
Where &lt;Any conditions you may have&gt;


I hope this is what you were looking for.