Web: fix last resort UOTD selection query

The query was failing with the error "Every derived table must have its own alias" thus not selecting a new user of the day.
This commit is contained in:
Christian Beer 2016-01-11 13:14:09 +00:00
parent 03ff02596b
commit fd41262f4f
1 changed files with 1 additions and 1 deletions

View File

@ -113,7 +113,7 @@ function select_uotd($force_new = false) {
// reshow a random one of the 100 least recently shown profiles.
//
$inner = "SELECT profile.userid FROM profile,user WHERE profile.userid=user.id AND verification=1 AND uotd_time>0 ORDER BY uotd_time ASC LIMIT 100";
$result = $db->do_query("SELECT * from ($inner) ORDER BY RAND() LIMIT 1");
$result = $db->do_query("SELECT * from ($inner) as t ORDER BY RAND() LIMIT 1");
}
if (!$result || $result->num_rows == 0) {