Skip to content

Commit

Permalink
Adding order to database_options for MySQL report types
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Crumm committed Mar 6, 2014
1 parent ca7e63f commit c8f91e5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions classes/report_types/MysqlReportType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit c8f91e5

Please sign in to comment.