I created the following query in order to produce a two-level navigation, Level one - categories Level two - subcategories
Ex. category - Year<br />
subcategories - 2013, 2012, 2011, 2010, 2009
It looks like this:
$query = "
SELECT categories.Category, categories.idCat, subcategories.subCategory, subcategories.idSub
FROM
categories
JOIN
cat_sub ON categories.idCat = cat_sub.idCat
JOIN
subcategories ON subcategories.idSub = cat_sub.idSub
ORDER BY
categories.idCat DESC,subcategories.idSub DESC";
The tables looks like this:
categories(idCat, Category)
subcategories(idSub, subCategory)
cat_sub(idCat, idSub)
I want to LIMIT the amount of subcategories to three, while keeping categories unlimited. Any help would be much appreciated!
Ex. ONLY DISPLAY
category - Year
subcategories - 2013, 2012, 2011
Hope I made things a bit more clear.
Thanks, Aleks