I working on project tintuc at http://www.xaluan.com
i have two table cuted to simple like this
table articles
ID - Title - Des - CatID
table category
CatID - catTitle
normally i will run a loop over category table to received CatID and catTile then run again loop on articles table to have 4 latest articles belong to that CatID
result on website like this
catTitle 1
- lastes article belong to catID 1
- second last artice belong to catID 1
catTitle 2
- lastess article belong to catID 2
- second last article belong to catID 2
I think the loop over category table then loop many time on article table for each catId is not effect way.
Please help with most effect mysql query to have same result.
thank a ton.