From 200c0cd237a817cc78686c4ee94fec5f388bc5f2 Mon Sep 17 00:00:00 2001 From: Chris Samarinas Date: Tue, 6 Sep 2016 23:59:11 +0300 Subject: [PATCH] Update suggest.php --- suggest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/suggest.php b/suggest.php index 160f2c4..89b015a 100644 --- a/suggest.php +++ b/suggest.php @@ -8,7 +8,7 @@ $date = time(); -$query = $db->query("SELECT query, type FROM queries WHERE query LIKE '$q%' ORDER BY count+count/POW(2,($date-first_date)/21600) DESC;"); +$query = $db->query("SELECT query, type FROM queries WHERE query LIKE '$q%' ORDER BY count+count/POW(2,($date-GREATEST(first_date,$date - 300000))/21600) DESC;"); while($data = $query->fetch_assoc()){ $suggestions[] = $data['query']; @@ -16,4 +16,4 @@ echo "[\"$q\", ".json_encode($suggestions).']'; -?> \ No newline at end of file +?>