include('global.php'); include('navigation.php'); $SQL = "SELECT * FROM categories where catBelow is NULL ORDER BY catOrder"; $rsThumbs = mysql_query($SQL, $conn) or die(mysql_error()); //$rsThumbs = mysql_query($sqlMainCats, $conn) or die(mysql_error()); $totalRecords = mysql_num_rows($rsThumbs); $totalRows = ceil($totalRecords / 5); $totalCells = $totalRows * 5; ?>
";
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 " | \n";
if (!bcmod($cell, 5) and $catName) echo "\t