Hauptkategorie zufügen\n \n"; } else echo "

\n"; ?>  "; if ($catName) { // CatId $catId = mysql_result($rsThumbs, $recordNr, catId); // Haal de foto met de hoogste photoHomepage op die direct onder de hoofdcategorie hangt $query1 = "select * from photos where photoCatId = ".$catId." order by photohomepage desc limit 0,1"; $result1 = mysql_query($query1, $conn) or die(mysql_error()); $photo1 = mysql_fetch_array($result1); $ID1 = $photo1['photoHomepage']; // Haal de foto met de hoogste photoHomepage op die onder 1 van de subcategorien hangt $query2 = "select p1.* from photos as p1 left outer join categories as c1 on c1.catid = p1.photocatid where c1.catBelow = ".$catId." order by photohomepage desc limit 0,1"; $result2 = mysql_query($query2, $conn) or die(mysql_error()); $photo2 = mysql_fetch_array($result2); $ID2 = $photo2['photoHomepage']; echo ""; // Kijk welke van de 2 gevonden foto's de hoogste waarde heeft in het veld photoHomepage if ($ID1 > $ID2) { echo "$catName"; } else { echo "$catName"; } echo "$catName"; } echo "\n"; if (!bcmod($cell, 5) and $catName) echo "\t\n\t\n"; } ?>