X-Git-Url: http://git.maemo.org/git/?p=speedfreak;a=blobdiff_plain;f=Server%2Fapplication%2Fmodels%2Fresult.php;fp=Server%2Fapplication%2Fmodels%2Fresult.php;h=a70d222ff3c0b0dc1c2acc2833dff6a8190e2006;hp=b7fd2831dba7156eb9273b399c73ef410d6fd879;hb=c9d3c3d94f18d97cf6a3657b84465401a5a08eb7;hpb=a83016359f8e1fe9a048f5f5eafed1a01b84ffe7 diff --git a/Server/application/models/result.php b/Server/application/models/result.php index b7fd283..a70d222 100644 --- a/Server/application/models/result.php +++ b/Server/application/models/result.php @@ -23,7 +23,7 @@ class Result_Model extends Model { * @return object|bool Returns object containing results if everything is ok and false otherwise */ public function get_results($category, $limit=10){ - $results = $this->db->query("SELECT u.username as username, c.unit as unit, r.value as value, r.result_date as result_date, c.slug as slug FROM users u, results r, categories c WHERE r.user_id=u.id AND c.slug = ? AND r.cat_id=c.id ORDER BY value DESC LIMIT ".(int)$limit, $category); + $results = $this->db->query("SELECT u.username as username, c.unit as unit, r.value as value, r.result_date as result_date, c.slug as slug FROM users u, results r, categories c WHERE r.user_id=u.id AND c.slug = ? AND r.cat_id=c.id ORDER BY r.value ASC LIMIT ".(int)$limit, $category); if ($results->count()>0) return $results; else