From 2351c107d465b33a560d826cfef45596bd098a77 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 15 Aug 2006 23:42:59 +0000 Subject: [PATCH] bug #166 --- scripts/updatesort.php | 15 +++++++++++++++ www/ac.php | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100755 scripts/updatesort.php diff --git a/scripts/updatesort.php b/scripts/updatesort.php new file mode 100755 index 0000000..9a6f140 --- /dev/null +++ b/scripts/updatesort.php @@ -0,0 +1,15 @@ +#!/usr/bin/php -q += 100"; + $res = mysql_query($query); + while($row = mysql_fetch_assoc($res)) + { + $query = "update `locations` set `acount`='${row['total']}' where `id`='${row['locid']}'"; + mysql_query($query); + } +?> diff --git a/www/ac.php b/www/ac.php index dd6f1c3..e00ce72 100644 --- a/www/ac.php +++ b/www/ac.php @@ -18,7 +18,7 @@ `countries`.`name` as `ccname` from `locations`, `regions`, `countries` where `locations`.`name` like '$loc%' and `regions`.`name` like '$reg%' and `countries`.`name` like '$ccname%' and `locations`.`regid`=`regions`.`id` and `locations`.`ccid`=`countries`.`id` - order by `locations`.`name` limit 10"; + order by `locations`.`acount` DESC, `locations`.`name` ASC limit 10"; $res = mysql_query($query); while($row = mysql_fetch_assoc($res)) {