Skip to content

Commit

Permalink
Merge pull request jdorn#126 from groundctrl/feature/db-option-orderby
Browse files Browse the repository at this point in the history
Adding order to database_options for MySQL report types
  • Loading branch information
jdorn committed Mar 7, 2014
2 parents ca7e63f + c8f91e5 commit fbf0a2f
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 fbf0a2f

Please sign in to comment.