Well, I have the code that makes the array, Its perfect, BUT im not sure how to handle the array 🙁 the code is
function fetch_results($value=''){
global $SQLObj;
global $bcrumb;
$array = array();
$sql = "SELECT * from `pages_categorys` WHERE `belongto` = '$value'";
$result = mysql_query( $sql ) ;
$i = 0;
while ($row = mysql_fetch_assoc($result)) {
$rows[$i]['category_id'] = $row['id'];
$rows[$i]['category_name'] = $row['category'];
$rows[$i]['parent_id'] = $row['belongto'];
$i++;
}
/*Now $rows should be a multi-array with your mySQL result in it. FOR is your friend, while is a tosser*/
for($i=0;count($rows)>$i;$i++){
if(empty($rows[$i]['category_id'])) continue;
$array[$i] = $rows[$i];
$result = fetch_results($rows[$i]['category_id']);
if(empty($result)) continue;
$array[$i]['sub'] = $result;
}
return $array;
}
Im not sure who coded this but it was someone from PHPBuilder.
Anyway, Is there any way I can get that print_r thing into a sorta breadcrumb navigation?
or just
DDD
DDD->Testingz
DDD->Testingz->Sub category
News
🙂#
Thanks in advance, Atomiku.