'-1' LIMIT 1 ;",$dbcnx); $arr_rez_cat1=array(); while ($rez_cat1=mysql_fetch_array($query_cat1, MYSQL_NUM)) { $arr_rez_cat1[]=$rez_cat1; } $count_cat1=count($arr_rez_cat1); if ($count_cat1==0) { header("Location: ".$URL."index.php"); } else { $name_cat1=$arr_rez_cat1[0][0]; $level_cat1=$arr_rez_cat1[0][1]; $parent_cat1=$arr_rez_cat1[0][2]; $query_cat1=mysql_query("UPDATE `category` SET `products` = `products`+1 WHERE `id` ='".$cat."' LIMIT 1 ;",$dbcnx); } //одиночные ссылки link по id $query_melkie=mysql_query("SELECT link,name FROM `text` WHERE `id` in (7,10,11) ORDER BY `id` ASC ;",$dbcnx); $arr_rez_melkie=array(); while ($rez_melkie=mysql_fetch_array($query_melkie, MYSQL_NUM)) { $arr_rez_melkie[]=$rez_melkie; } ?> Каталог - <? echo $name_cat1;?>

Каталог

"; for ($i91=0; $i91<$count_cat91; $i91++) { echo ""; } echo ""; $query_cat92=mysql_query("SELECT id,name,level,parent_id FROM `category` WHERE `level` = '2' and `parent_id`='".$cat."' ORDER BY `sort` ",$dbcnx); $arr_rez_cat92=array(); while ($rez_cat92=mysql_fetch_array($query_cat92, MYSQL_NUM)) { $arr_rez_cat92[]=$rez_cat92; } $count_cat92=count($arr_rez_cat92); echo ""; } // level 2 else if ($level_cat1=='2') { $query_cat91=mysql_query("SELECT id,name,level,parent_id FROM `category` WHERE `level` = '1' ORDER BY `sort` ",$dbcnx); $arr_rez_cat91=array(); while ($rez_cat91=mysql_fetch_array($query_cat91, MYSQL_NUM)) { $arr_rez_cat91[]=$rez_cat91; } $count_cat91=count($arr_rez_cat91); echo ""; $query_cat92=mysql_query("SELECT id,name,level,parent_id FROM `category` WHERE `level` = '2' and `parent_id`='".$parent_cat1."' ORDER BY `sort` ",$dbcnx); $arr_rez_cat92=array(); while ($rez_cat92=mysql_fetch_array($query_cat92, MYSQL_NUM)) { $arr_rez_cat92[]=$rez_cat92; } $count_cat92=count($arr_rez_cat92); echo ""; $query_cat93=mysql_query("SELECT id,name,level,parent_id FROM `category` WHERE `level` = '3' and `parent_id`='".$cat."' ORDER BY `sort` ",$dbcnx); $arr_rez_cat93=array(); while ($rez_cat93=mysql_fetch_array($query_cat93, MYSQL_NUM)) { $arr_rez_cat93[]=$rez_cat93; } $count_cat93=count($arr_rez_cat93); echo ""; } // level 3 else if ($level_cat1=='3') { $query_cat90=mysql_query("SELECT parent_id FROM `category` WHERE `id`='".$parent_cat1."' ORDER BY `sort` ",$dbcnx); $arr_rez_cat90=array(); while ($rez_cat90=mysql_fetch_array($query_cat90, MYSQL_NUM)) { $arr_rez_cat90[]=$rez_cat90; } $count_cat90=count($arr_rez_cat90); $parent_parent_cat1=$arr_rez_cat90[0][0]; $query_cat91=mysql_query("SELECT id,name,level,parent_id FROM `category` WHERE `level` = '1' ORDER BY `sort` ",$dbcnx); $arr_rez_cat91=array(); while ($rez_cat91=mysql_fetch_array($query_cat91, MYSQL_NUM)) { $arr_rez_cat91[]=$rez_cat91; } $count_cat91=count($arr_rez_cat91); echo ""; $query_cat92=mysql_query("SELECT id,name,level,parent_id FROM `category` WHERE `level` = '2' and `parent_id`='".$parent_parent_cat1."' ORDER BY `sort` ",$dbcnx); $arr_rez_cat92=array(); while ($rez_cat92=mysql_fetch_array($query_cat92, MYSQL_NUM)) { $arr_rez_cat92[]=$rez_cat92; } $count_cat92=count($arr_rez_cat92); echo ""; $query_cat93=mysql_query("SELECT id,name,level,parent_id FROM `category` WHERE `level` = '3' and `parent_id`='".$parent_cat1."' ORDER BY `sort` ",$dbcnx); $arr_rez_cat93=array(); while ($rez_cat93=mysql_fetch_array($query_cat93, MYSQL_NUM)) { $arr_rez_cat93[]=$rez_cat93; } $count_cat93=count($arr_rez_cat93); echo ""; } ?>
0) { echo "
Количество найденых разновидностей: ".$count_cats1."
"; ?> "; for ($i1=0; $i1<$count_cats1; $i1++) { $query_cats2=mysql_query("SELECT id,gost,country,ed_id,company_id FROM `product` WHERE `parent_id` = '".$cat."' and `name`='".$arr_rez_cats1[$i1][0]."' ORDER BY `company_id` ASC ;",$dbcnx); $arr_rez_cats2=array(); while ($rez_cats2=mysql_fetch_array($query_cats2, MYSQL_NUM)) { $arr_rez_cats2[]=$rez_cats2; } $count_cats2=count($arr_rez_cats2); echo "
  ".$arr_rez_cats1[$i1][0]." - "; echo kol_pred($count_cats2); echo "
"; echo " "; } echo "
"; } else { } ?>