$section_list[1]"; $query1 = "SELECT id, category FROM $table_pages WHERE section = '$section' GROUP BY category"; // getting catlist $result2 = mysql_query($query1); while ($cat_list = mysql_fetch_array($result2)) //loop through categories { $category1 = htmlspecialchars(rawurlencode($cat_list[1])); if (!empty ($cat_list[1]) and ($section_list[0] == $section)) //only display when categrory has no blanks { if ($i == 1) { print ""; } if ($i == 1) { print "
"; } } ?>