Lid |
|
Ik heb een script om downloads toe te voegen, er zijn nu 2 categorieën met elk hun subcategorie(ën).
Zo is er hoofdcategorie 1, en 2. Hoofdcategorie1 heeft 2 subcategorieën, nummer 2 heeft er 1.
Nu is het zo dat hij bij het select rijtje dit laat zien:
hoofdcategorie 1
---------------
subcategorie1
hoofdcategorie 1
---------------
subcategorie2
hoofdcategorie2
---------------
subcategorie1
hoofdcategorie 1 --------------- subcategorie1 hoofdcategorie 1 --------------- subcategorie2 hoofdcategorie2 --------------- subcategorie1
ipv:
hoofdcategorie 1
---------------
subcategorie1
subcategorie2
hoofdcategorie2
---------------
subcategorie1
hoofdcategorie 1 --------------- subcategorie1 subcategorie2 hoofdcategorie2 --------------- subcategorie1
Weet iemand hoe ik het wel zo kan krijgen? dit is het gedeelte van het script waar dit plaats vind:
<select name="subcato">
<option></option>
<? $file = "SELECT * FROM games_downloads WHERE hoofdcat !='' ";
$filereturn = mysql_query($file);
while ($list = mysql_fetch_object($filereturn)) {
$file2 = "SELECT * FROM games_downloads WHERE catid ='".$list->id."' ";
$filereturn2 = mysql_query($file2);
while ($list2 = mysql_fetch_object($filereturn2)) {
echo"
<option value=\"\">".$list->hoofdcat."</option>
<option>---------</option>
<option value=\"".$list2->id."\">".$list2->subcat."</option>"; }}?>
<select name="subcato"> <option></option> <? $file = "SELECT * FROM games_downloads WHERE hoofdcat !='' "; $file2 = "SELECT * FROM games_downloads WHERE catid ='".$list->id."' "; <option value=\"\">".$list->hoofdcat."</option> <option>---------</option> <option value=\"".$list2->id."\">".$list2->subcat."</option>"; }}?>
@ Tuinstoel, het vorige probleem was ongeveer zoiets als dit. Maar ik zal er volgende keer rekening mee houden
|