Skip to content

Commit

Permalink
avoid group by for compat with mysql 5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
orthagh committed Sep 12, 2016
1 parent 9f38769 commit 093184a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions inc/alert.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public static function findAllToNotify($show_only_login_alerts = false,
$entity_sql = getEntitiesRestrictRequest("AND", $table, "", "", true, true);
}

$query = "SELECT `$table`.*
$query = "SELECT DISTINCT `$table`.`id`, `$table`.*
FROM `$table`
LEFT JOIN `$utable`
ON `$utable`.`plugin_news_alerts_id` = `$table`.`id`
Expand All @@ -181,8 +181,7 @@ public static function findAllToNotify($show_only_login_alerts = false,
OR `$table`.`date_end` = '$today'
)
AND `is_deleted` = 0
$entity_sql
GROUP BY `$table`.`id`";
$entity_sql";

if ($result = $DB->query($query)) {
if ($DB->numrows($result) < 1) {
Expand Down

0 comments on commit 093184a

Please sign in to comment.