I am working on simple site script with few categories to be displayed on the top of my page as navigation links.
Part of the code looks like this:
$result = mysql("$DBName","SELECT Name, CatID FROM My_Cats WHERE CatID != '$CatID' ORDER BY CatID") or die(mysql_error());
while ($row = mysql_fetch_row($result)) {
$ZZName = $row[0];
$ZZCatID = $row[1];
echo "<a href=\"$PHP_SELF?CatID=$ZZCatID\">$ZZName</a>";
}
Also in the script, to get Category ID I have:
if (!$CatID) {
$CatQuery = "CatID LIKE '%%'";
} else {
$CatQuery = "CatID = '$CatID'";
}
The codes are working fine where it lists all categories as links on the top of the first page (index.php). However, once any one of the categories is clicked on, it will display the correct results on the rest of the page, but also remove that category from the list of links on the top of the index page. I've been trying to get it to not remove the current category but just remove the link from it, leaving the category listed in its own place (just not clickable).
If anyone knows what to do, please advise. I will appreciate your help.
Thank you