"; } echo ""; $category_name = sql_query(" select * from $tb_categories where ID = '$Category' "); $name = sql_fetch_array($category_name); echo ""; $related = sql_query(" select * from $tb_related where cat_id = '$Category' "); while($related_array = sql_fetch_array($related)){ echo ""; if(isset($fm)){echo "";} if(isset($list)){echo "";} echo ""; if(isset($fm)){echo "";} if(isset($list)){echo "";} echo ""; } echo "
Edit Related Categories"; if(isset($update)){echo " - Update Complete";} if(isset($add)){echo " - Addition Complete";} if(isset($delete)){echo " - Deletion Complete";} echo "
Category: "; unset($gcid); if(isset($name["ID"])){ $gcid = $name["ID"]; } while($gcid > 0){ $mlc_sql = " select * from $tb_categories where ID = '$gcid' "; $mlc_query = sql_query($mlc_sql); $mlc_array = sql_fetch_array($mlc_query); $cat_array[] = $mlc_array["Category"]; $pid_array[] = $mlc_array["ID"]; $gcid = $mlc_array["PID"]; } $count = sizeof($pid_array); for($depth=$count;$depth>=0;$depth--){ if($pid_array[$depth]){ echo ">> ".ereg_replace("_"," ",($cat_array[$depth])); if($gcid > 0){ echo "  "; } } } echo " 
Related:

"; echo ""; echo ""; if(isset($fm)){echo "";} if(isset($list)){echo "";} echo ""; if((isset($update) || isset($add) || isset($delete)) && isset($fm)){ ?>
Add New Relationship
Related: "; echo "
\">
Return to Categories
Return to Unrelated List