i worte this script to access the category table and dispaly all the sub category which is related to the current category for example if is in empire then it should show like this:
/news/some thing/some slknf/empire
but it shows like this:
/some slknf/some thing/news///////////////////empire
can you edit and paste some code. please i been working on this more then a weeks.
$cat_sql = "select from category where category_id = '$cat_id'";
$cat_sql_result = mysql_query($cat_sql);
$cat_sql_num_row = mysql_num_rows($cat_sql_result);
$cat_sql_row = mysql_fetch_array($cat_sql_result);
$cat_subs_id = $cat_sql_row["category_subs"];
if(0 < $cat_sql_num_row){
while($i <= 20){
$cat_sql2 = "SELECT FROM category where category_id = '$cat_subs_id'";
$cat_sql_result2 = mysql_query($cat_sql2);
$cat_sql_row2 = mysql_fetch_array($cat_sql_result2);
printf("/<a href=\"%s?cat_id=%s\">%s</a>", $REDRICT_URI, $cat_sql_row2['category_id'], $cat_sql_row2['category_name']);
$row_cat_id = $cat_sql_row2["category_id"];
$cat_subs_id = $cat_sql_row2["category_subs"];
$i++;
}
echo "/".$cat_sql_row['category_name'];
}
else{
echo " This is not right category id";
}