$filter .="<option value='ALL' selected=selected> All Months - [" . $allcnt . "] </option>";
$query = "select LockerInfo_IDNo, ExpiryDate, count(LockerInfo_IDNo) count1 from lockerinfo
WHERE ExpiryDate<>''
group by MONTH(ExpiryDate)
order by ExpiryDate ";
$result = mysql_query($query) or die('101. Query failed: ' . mysql_error());
while ($row=mysql_fetch_array($result)){
if($mnt==date("d-m-Y",$row['ExpiryDate']))
$filter .="<option value='" . $row['ExpiryDate'] . "' selected=selected> " . $space1 . date("M",$row['ExpiryDate']) . " - [" . $row['count1'] . "]</option>";
else
$filter .="<option value='" . $row['ExpiryDate'] . "'> " . $space1 . date("M",$row['ExpiryDate']) . " - [" . $row['count1'] . "]</option>";
}
$filter .=" </select>";
echo $filter;
这是我在此列表框中的查询值应该按月分组...如果使用此查询意味着它仅显示 2 条记录...但我在 db 中有 535 个值...帮帮我