From 03f2cab8ffbc20e1d04b342ac8b635bf1a24c894 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Sun, 27 Jan 2013 12:40:13 +0100 Subject: reportall: Order results by id --- sqlbox/reportall.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sqlbox') diff --git a/sqlbox/reportall.php b/sqlbox/reportall.php index 035dfe8..41c6d78 100644 --- a/sqlbox/reportall.php +++ b/sqlbox/reportall.php @@ -27,7 +27,7 @@ $PAGE->set_context($context); echo $OUTPUT->header(); -$boxes = $DB->get_records("sqlbox"); +$boxes = $DB->get_records_sql("SELECT * FROM {sqlbox} ORDER BY id"); $b = array(); foreach ($boxes as $box) $b[$box->id] = $box->name; @@ -46,7 +46,7 @@ foreach ($users as $user) { $solutions = $DB->get_records_sql("SELECT s.id, sol.correct FROM {sqlbox} s LEFT JOIN ( SELECT sqlboxid,correct FROM {sqlbox_solutions} WHERE userid=:id) as sol - ON s.id = sol.sqlboxid", + ON s.id = sol.sqlboxid ORDER BY s.id", array('id'=>$user->id)); $s = array(); foreach ($solutions as $solution) -- cgit