Query Only Specified Number Of Items From Parent/Child Categories
- by RogeR
I'm having trouble figureing out how to query every item in a certain category and only list the newest 10 items by date. Here is my table layout:
download_categories
category_id (int) primary key
title (var_char)
parent_id (int)
downloads
id (int) primary key
title (var_char)
category_id (int)
date (date)
I need to query every file in a main category that lets say has 100 items and 5 child categories and only spit out the last 10 added. I have functions right now that just add up all the files so I can get a count by category, but I can't seem to modify the code to only display a certain amount of items based on the date.