-1
結合的第1列再總結行的第2列到total,那麼令我有4列的數據庫:結果通過DESC
- 位置
- 日期
- TEAM_NAME
- 分數
我需要結果頁面來選擇和組合「Team_Name」,當等於和SUM「Score」AS Total並且僅顯示當前月份在單個位置「BW3Avon」。
這裏是我的代碼
<?php
$con = mysql_connect("localhost","*******_admin","g********1");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("x0kqgoub_bw3avonscore", $con);
$sql = "SELECT * FROM bw3avonscore WHERE MONTH(myDate) = MONTH(CURRENT_DATE)";
$result = mysql_query("SELECT * FROM bw3avonscore Team_Name ORDER BY Score DESC");
while($row = mysql_fetch_array($result))
{
echo $row['Team_Name'] . " " . $row['Score'];
echo "<br />";
}
mysql_close($con);
?>