Hi, guys, I am trying to make a small project, but I am stuck over a menu. The thing is that I want to make dynamic menu with categories and I want when I click on a category, the code to polulate subcategories below it, but only from selected catid… I tryed everything I know, but it was not enough - it spins out all subcats. I will appreciate some help…the code so far is the following:
[php]while($cats_list = mysql_fetch_assoc($get_cats_result))
{
$cat_replace = str_replace(" “,”-",$cats_list[‘name’]);
$cat_replace = str_replace("–","-",$cat_replace);
echo “<a href='categor-”.$cat_replace."/".$cats_list[‘idtt’]."’> “.$cats_list[‘accname’].”
“;
$id_cat=(int)$_GET[‘category’];
$sub= “SELECT idtt, catidnum, accname FROM subbasecat WHERE catid=”.$id_cat.” ORDER BY name ASC";
$get_sub_result = mysql_query($sub);
while($sub_list = mysql_fetch_assoc($get_sub_result))
{
$cat_replace = str_replace(" ","-",$cat_za_profile['accname']);
$cat_replace = str_replace("--","-",$cat_replace);
$subcat_replace = str_replace(" ","-",$sub_list['accname']);
$subcat_replace = str_replace("--","-",$subcat_replace);
echo "cat-".$cat_replace."/".$sub_list['catidnum']."/subcat-".$subcat_replace."/".$sub_list['idtt']."'>>><img src='img/list_icon.png' width='15' height='15'/> ".$sub_list['accname']."</a><br /> ";
}
}[/php]