Change this:
PHP Code:
while ($cat = $DB_site->fetch_array($categories))
{
$cat_cache[$cat['parentcategory']][] = $cat;
}
To This:
PHP Code:
while ($cat = $DB_site->fetch_array($categories))
{
$cat_cache[$cat['parentcategory']][] = $cat;
}
echo '<pre>';
print_r($cat_cache);
echo '</pre>';
You'll be able to see how the array looks and works better then (only for development purposes of course