"; $link = mysql_connect($host,$user,$password); $requete=mysql_db_query($base,"select id, nomcat from ".$basecat." where idsubcat=0 order by prio",$link); $num=mysql_num_rows($requete); if($num==0) { echo "Pas de catégories de niveau 0"; } else { echo ""; $i=0; $ligne=0; while ( $i<$num ) { if ($ligne==0) { echo ""; } $nomcat = mysql_result($requete,$i,"nomcat"); $nomcat=lire($nomcat); $id = mysql_result($requete,$i,"id"); echo ""; $ligne++; if ($ligne==2) { echo ""; $ligne=0; } $i++; } echo "
".$nomcat.""; $requete2=mysql_db_query($base,"select * from ".$basecat." where idsubcat=".$id." order by prio",$link); $num2=mysql_num_rows($requete2); if($num2!=0) { echo "
"; $i2=0; if ($num2>3) { $num2=3; } while ( $i2<$num2 ) { $nomcat2 = mysql_result($requete2,$i2,"nomcat"); $nomcat2=lire($nomcat2); $id2 = mysql_result($requete2,$i2,"id"); echo "".$nomcat2."  "; $i2++; } } echo "
"; } ?>