From fd41262f4f66d6bb18e97e1d6af8530729656faa Mon Sep 17 00:00:00 2001 From: Christian Beer Date: Mon, 11 Jan 2016 13:14:09 +0000 Subject: [PATCH] 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. --- html/inc/uotd.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/inc/uotd.inc b/html/inc/uotd.inc index 00e9ab3e56..761dbfcbce 100644 --- a/html/inc/uotd.inc +++ b/html/inc/uotd.inc @@ -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) {