Hi
Im using the code below to create Yahoo type categorie navigation links it works fine except it puts the top category at the end and the current category at the begining.
function breadcrumbs($categoryid)
{
$res = mysql_query("select * from CatTable WHERE CatID='$categoryid'");
$r = mysql_fetch_array($res);
$catid = $r[CatID];
$categoryid = $r[CatParent];
$name = $r[CatName];
echo " >> <a href=\"viewcat.php?categoryid=$catid\">$name</a>";
$result = mysql_query("select CatParent from CatTable WHERE CatParent='$categoryid'");
$row = mysql_fetch_array($result);
$categoryid = $row[CatParent];
if ($categoryid > 0)
{
breadcrumbs($categoryid);
}
else
{
return;
}
}
breadcrumbs($categoryid);
You can see what I mean at
http://www.digibitz.com/newcategory.php?categoryid=5
Anyone got suggestions?
Thanks