<?
include "../Connections/conn.php";
$sql="select * from member, branch, awards where member.id_branch=branch.id_branch and member.id_stu=awards.id_stu GROUP BY member.id_branch";
$r=mysql_db_query($dbname, $sql);
while($data=mysql_fetch_array($r)){
$id_stu=$data[id_stu];
echo"
<tr>
<td><a href='showaward1.php?id_view=$id_stu'>$data[name] $data[lastname]</a></td>
<td>$data[branch]</td>
<td>$data[date]/$data[month]/$data[year]</td>
</tr>";
}
mysql_close();
?>
Tag : - - - -
Date :
2010-03-03 13:35:39
By :
axiom
View :
3193
Reply :
3
No. 1
Guest
เพิ่ม Order by ให้กับข้อมูลต่อท้าย GROUP BY น่ะครับ
$sql="select * from member, branch, awards where member.id_branch=branch.id_branch and member.id_stu=awards.id_stu GROUP BY member.id_branch ORDER BY branch.date";
select *
from member, branch, awards
where member.id_branch=branch.id_branch and member.id_stu=awards.id_stu
GROUP BY member.id_branch"
order by branch.year desc,
branch.month desc,
branch.date desc