如何按城市或按降序排列此数组?如何对php和sql数组进行排序?
if ($num > 0) {
$i=0;
while ($i < $num) {
$city = mysql_result($result,$i,"city");
$state = mysql_result($result,$i,"state");
$id = mysql_result($result,$i,"id");
echo "$city";
echo "$state";
++$i; } } else { echo "No results."; } ?>
在查询中把一个'为了by'条款? – Donnie 2010-06-03 02:45:41
唐尼 - 如果你做出了答案,那将是最好的。 – 2010-06-03 02:52:14
谢谢,这对按id降序排序非常有用。我怎么只显示一个城市? – Jon 2010-06-03 02:53:53