下面顯示的這個程序,程序不能打印php文件中顯示的數據表。我需要你的幫助,看看我的sql和表中有什麼問題。while循環php在sql tablle
$result = mysql_query("SELECT DATE_FORMAT(thedate, '%Y %M %D') AS d, count(semail) AS av FROM `ecard2008` WHERE `sflag`='1' AND `thedate`>='2000-12-12' GROUP BY `thedate`")or die(mysql_error());
echo "<table border='1'>
<tr>
<th>Date</th>
<th>Daily Volume</th>
<th>Sent</th>
<th>Pending</th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['d'] . "</td>";
echo "<td>" . $row['av'] . "</td>";
echo "<td>" . $row['av'] . "</td>";
echo "<td>" . $row['av'] . "</td>";
echo "</tr>";
}
echo "</table>";
你迴應並直接在phpmyadmin運行此查詢? –
是的,你是否從查詢中得到任何錯誤? – nowhere
是的,下面的答案應該使用mysql_或mysqli_。不是都 –