Select a Category
Each category contains one or more topics. Click on the Category that best describes the subject matter of the document, and you will be provided with a list of topics from which to narrow down your selection. Click on a Category again to collapse it. Click on the appropriate topic to view the list of products, chapters, data briefs, fact sheets, or reports which relate to that topic.
query($qCategories);
//Construct html list of Categories; for each Category, execute query for topic list.
//NOTE: this is not recursive, and thus is only capable of dealing with a two-level hierarchy.
$categoryName = "";
if ($result) {
while($row = $result->fetch_assoc()) {
$categoryID = $row["WebTopicID"];
$categoryName = $row["WebTopicName"];
echo "
" . $categoryName . "
"; $qSubCategories = "SELECT WebTopicID, WebTopicNickname, WebTopicName, ParentID FROM WebTopics WHERE ParentID=" . $categoryID . " ORDER BY WebTopicName"; $subCatListRS = $conn->query($qSubCategories); echo "";
while($row2 = $subCatListRS->fetch_assoc()) {
$subCategoryID = $row2["WebTopicID"];
$subCatName = $row2["WebTopicName"];
echo "" . $subCatName . "";
}
echo "
";
}
} else {
echo mysql_error();
}
$result->free();
$subCatListRS->free();
$conn->close();
?>






