Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Dėl select skirtuko

Parašė WebDraw· 2010 Rugs. 18 13:09:12
#2


 
<?php
 echo "<select name='name'>";
 $query = mysql_query("SELECT class FROM lentele GROUP BY class");
while($row = mysql_fetch_array($query)){
echo "<optgroup label='{$row[class]}'>";
 
  $query2 = mysql_query("SELECT id,name FROM lentele WHERE class= '$row[class]' ");
           while($row2 = mysql_fetch_array($query2)){
                  echo "<option value='{$row2[id]}'>-- {$row2[name]}</option>";
            }
echo "</optgroup>";
 }
 
 echo "</select>";
?>
 
 
 

Klaidu turbut yra, bet gal issitaisysi

Redagavo WebDraw· 2010 Rugs. 18 13:09:03