pull/1/head
root 18 years ago
parent be787c1b86
commit 2351c107d4

@ -0,0 +1,15 @@
#!/usr/bin/php -q
<?
include_once("../includes/mysql.php");
$query = "SELECT `users`.`locid` AS `locid`, count(*) AS `total` FROM `users`, `notary`
WHERE `users`.`id` = `notary`.`to` AND `users`.`locid` != 0
GROUP BY `users`.`id`, `users`.`locid`
HAVING sum(`notary`.`points`) >= 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);
}
?>

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

Loading…
Cancel
Save