我正在努力与我的PHP,并会喜欢在正确的方向一些援助。这是我到目前为止的代码:SQL ORDER BY /排序Php
<?php
$connection = mysql_connect("localhost", "root") or die(mysql_error());
mysql_select_db("rsi", $connection) or die(mysql_error());
$query = "SELECT * FROM events";
$result = mysql_query ($query) or die ("error in query");
if (mysql_num_rows($result)>0) {
echo "<table border=1></tr>" .
"<th>ID</th>" .
"<th>Name</th>" .
"<th>Date</th>" .
"<th>Location</th>" ;
while ($row = @ mysql_fetch_array($result)){
print "<tr>";
print "<td>".$row['id']."</td>";
print "<td>".$row['name']."</td>";
print "<td>".$row['date']."</td>";
print "<td>".$row['location']."</td>";
print "</tr>";
}
print "</table>";
}
?>
我现在希望通过点击每个命令从数据库中结果/任何头(例如日期)的。谢谢你的时间。