Eğer yanlış anlamadıysam her kategoriden 10 ar tane çekmek istiosn ?
Bunun 2 yöntemi var kategorilerin sınırlıysa eğer bunu tek sorguda union ile yaparsın
$sql="
SELECT id, title, catid FROM jos_content jc WHERE sectionid=4 AND catid=4 LIMIT 10
UNION ALL
SELECT id, title, catid FROM jos_content jc WHERE sectionid=4 AND catid=3 LIMIT 10
UNION ALL
SELECT id, title, catid FROM jos_content jc WHERE sectionid=4 AND catid=2 LIMIT 10
UNION ALL
SELECT id, title, catid FROM jos_content jc WHERE sectionid=4 AND catid=1 LIMIT 10
";
yok sınırlıysa eğer once kategorileri seçer dongüye sokarsın ya da bu sorguyu yine döngüyle oluşturusun