Here is my code,
i set a 'display' column in my category table whether it display or not.
lets say, i have
A
-A.1
B
-B.1
and i only want to display A.1 and B.1. when i set A and B to display N.
my category list display nothing.
Any idea?
function current_categories($m,$id){
$cat_array=array();
$sql = "select * from `category`";
$query = DB::Query($sql);
while($row = DB::fetch_array($query)){
$cat_array[] = array($row['id'],$row['name'],$row['pid'],$row['sort'],$row['display']);
}
$n = str_pad('',$m,'-',STR_PAD_LEFT);
$n = str_replace("-"," ",$n);
for($i=0;$i<count($cat_array);$i++){
if($cat_array[$i][2]==$id && $cat_array[$i][4] == 'Y'){
echo "<li>"."<a href=\"/team/index.php?gid=".$cat_array[$i][0]."\">".$cat_array[$i][1]."</a></li>";
current_categories($m+2,$cat_array[$i][0]);
}
}
}