http://www.eaoo.com/design/list.asp?classid=2&Nclassid=9

解决方案 »

  1.   

    <?php
                 echo "<select name='select' onchange=changeyears(this)>";
                 echo "<option value='XXX.php' selected>年</option>";
                $sqlyear = "select DISTINCT FIELD from TABLE ";
                $queryyear = mysql_query($sqlyear,$db);
                while($rowyear = mysql_fetch_array($queryyear))
                {
                   if($years == $rowyear["FILED"])
                   {
                       echo "<option value='XXX.php?years=".$rowyear["FILED"]."' selected>".$rowyear["FILED"]."年</option>";
                      }
                      else
                      {
                       echo "<option value='XXX.php?years=".$rowyear["FILED"]."'>".$rowyear["FILED"]."年</option>";
                      }
                }
                echo "</select>";
                echo "&nbsp;";
                echo "<select name='select2' onchange=changemonths(this)>";
                echo "<option value='XXX.php' selected>月</option>";
                if($years != "")
                {
                 $sqlm="select DISTINCT FILED from TABLE where FILED = $years";
                 $querym = mysql_query($sqlm,$db);
                 while($rowm = mysql_fetch_array($querym))
                 {
                       if($months == $rowm["FILED"])
                   {
                       echo "<option value='XXX.php?years=".$years."&months=".$rowm["FIELD"]."'  selected>".$rowm["FIELD"]."月</option>";
                         }
                       else
                       {
                       echo "<option value='XXX.php?years=".$years."&months=".$rowm["FILED"]."'>".$rowm["FILED"]."月</option>";
                       }
                    }
              }
                echo "</select>";
    ?>不知道行不?
      

  2.   

    <?php
                 echo "<select name='select' onchange=changeyears(this)>";
                 echo "<option value='XXX.php' selected>年</option>";
                $sqlyear = "select DISTINCT FIELD from TABLE ";
                $queryyear = mysql_query($sqlyear,$db);
                while($rowyear = mysql_fetch_array($queryyear))
                {
                   if($years == $rowyear["FILED"])
                   {
                       echo "<option value='XXX.php?years=".$rowyear["FILED"]."' selected>".$rowyear["FILED"]."年</option>";
                      }
                      else
                      {
                       echo "<option value='XXX.php?years=".$rowyear["FILED"]."'>".$rowyear["FILED"]."年</option>";
                      }
                }
                echo "</select>";
                echo "&nbsp;";
                echo "<select name='select2' onchange=changemonths(this)>";
                echo "<option value='XXX.php' selected>月</option>";
                if($years != "")
                {
                 $sqlm="select DISTINCT FILED from TABLE where FILED = $years";
                 $querym = mysql_query($sqlm,$db);
                 while($rowm = mysql_fetch_array($querym))
                 {
                       if($months == $rowm["FILED"])
                   {
                       echo "<option value='XXX.php?years=".$years."&months=".$rowm["FIELD"]."'  selected>".$rowm["FIELD"]."月</option>";
                         }
                       else
                       {
                       echo "<option value='XXX.php?years=".$years."&months=".$rowm["FILED"]."'>".$rowm["FILED"]."月</option>";
                       }
                    }
              }
                echo "</select>";
    ?>不知道行不?
      

  3.   

    http://expert.csdn.net/Expert/topic/2246/2246328.xml?temp=.3216669