diff --git a/classes/report_types/MysqlReportType.php b/classes/report_types/MysqlReportType.php index 21d6573b..3cd0b191 100644 --- a/classes/report_types/MysqlReportType.php +++ b/classes/report_types/MysqlReportType.php @@ -91,6 +91,10 @@ public static function getVariableOptions($params, &$report) { if(isset($params['where'])) { $query .= ' WHERE '.$params['where']; } + + if(isset($params['order']) && in_array($params['order'], array('ASC', 'DESC')) ) { + $query .= ' ORDER BY '.$params['column'].' '.$params['order']; + } $result = mysql_query($query, $report->conn);