$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 "";
} //only print the first time
$i++;
print "- $cat_list[1]
";
}
if (($cat_list[1] == $category) and ($section_list[0] == $section))
{
$query1 = "SELECT id, name, module, category FROM $table_pages WHERE category = '$category' and section = '$section' ORDER BY sort";
$result1 = mysql_query($query1);
print "";
}
}
if ($i > 1)
{
print "
";
}
if ($i == 1)
{
print "
";
}
}
?>