ah ...
$query = "SELECT cat.id as cat_id, cat.name as cat_name, subcat.id as subcat_id, subcat.pid as subcat_pid, subcat.name as subcat_name FROM cat LEFT JOIN subcat ON subcat.pid = cat.id";
$result = mysql_query($query);
$currentCatID = false;
while($row = mysql_fetch_assoc($result))
{
if($currentCatID != $row['cat_id'])
{
$currentCatID = $row['cat_id'];
$output .= "<li class=\"level0 nav-2 parent\" onmouseover=\"toggleMenu(this,1)\" onmouseout=\"toggleMenu(this,0)\">
<a href=\"product.php?cat={$row['cat_id']}\">
<span>{$row['name']}</span>
</a>\n";
}
$output .= "<ul class=\"level0\">
<li class=\"level1 nav-2-1 first\">
<a href=\"product.php?cat=$catid&subid={$row['subcat_id']}\">
<span>{$row['subcat_name']}</span>
</a>
</li>
</ul>
</li>";
}
Now it's doing the parent category in the top output and the bottom but no error?