Hello every one
I need help help with tihs code, it works but is there an easy way to generate articles by categories and subcategories
if($result = GetList("SELECT p.*,f.*,c1.*
FROM ".DB_PREFIX."mediaCategory c1
LEFT JOIN ".DB_PREFIX."mediaCategory c2 ON c2.category_id=c1.category_parent
LEFT JOIN ".DB_PREFIX."mediaCategory c3 ON c3.category_id=c2.category_parent
LEFT JOIN ".DB_PREFIX."mediaCategory c4 ON c4.category_id=c3.category_parent
LEFT JOIN ".DB_PREFIX."mediaCategory c5 ON c5.category_id=c4.category_parent
LEFT JOIN ".DB_PREFIX."mediaCategory c6 ON c6.category_id=c5.category_parent
LEFT JOIN ".DB_PREFIX."mediaPost p ON c1.category_id=p.post_category
WHERE (c1.category_id=1 OR c1.category_parent=1 OR c2.category_parent=1 OR c3.category_parent=1 OR c4.category_parent=1 OR c5.category_parent=1 OR c6.category_parent=1)
ORDER BY p.post_created LIMIT 10")){
echo "<ul class='grid'>";
foreach ($result as $row) {
echo "<li class='ID-".$row['post_id']."'><span><h3>".$row['post_name'])."</h3></span></li>";
}
echo "</ul>";
}