From d1aaba539247b3602d8e7351ecdc694c5cdc33d1 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Fri, 23 Nov 2012 10:15:28 +0100 Subject: sqlbox: Compare user query results from a definable query --- sqlbox/view.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sqlbox/view.php') diff --git a/sqlbox/view.php b/sqlbox/view.php index d095376..5c7c4e1 100644 --- a/sqlbox/view.php +++ b/sqlbox/view.php @@ -85,10 +85,15 @@ if (isset($data->sqlbox_query)) { error("Failed to connect to sqlbox db"); $table = db_get_table_from_query($db, $data->sqlbox_query); + $table_orig = db_get_table_from_query($db, $sqlbox->query); + pg_close($db); echo html_writer::table($table); - - pg_close($db); + + if ($table->data == $table_orig->data && $table->head == $table->head) + echo $OUTPUT->heading("Correct!"); + else + echo $OUTPUT->heading("Incorrect!"); } // Finish the page -- cgit