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)) {