if (empty($result)) {echo "<h2>没有查到哦</h2>";}
else {
$numRows = mssql_num_rows($result); 
echo "<table border='1'>
<tr>
<th>月份</th>
<th>抄表数</th>
</tr>
";
while($row=mssql_fetch_array($result))
{
echo"<tr>";
echo"<td>";
echo $row[1];
echo"</td>";
echo"<td>$row[4]</td>";
echo"</tr>";
}
mssql_close($dbhandle);
}没有效果,还是去查询,输出空的表格表头。