From 40408bf6dd4a06f9c5c29bcbc60efd74e3754da3 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 2 Jan 2017 11:05:08 -0500 Subject: [PATCH] fix sql queries --- web/skins/classic/views/timeline.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/skins/classic/views/timeline.php b/web/skins/classic/views/timeline.php index 6f0da98aa..0f3d52d40 100644 --- a/web/skins/classic/views/timeline.php +++ b/web/skins/classic/views/timeline.php @@ -143,11 +143,11 @@ foreach( dbFetchAll( $monitorsSql ) as $row ) } $rangeSql = "select min(E.StartTime) as MinTime, max(E.EndTime) as MaxTime from Events as E inner join Monitors as M on (E.MonitorId = M.Id) where not isnull(E.StartTime) and not isnull(E.EndTime)"; -$eventsSql = "SELECT * FROM Events WHERE NOT isnull(StartTime)"; +$eventsSql = "SELECT * FROM Events AS E WHERE NOT isnull(StartTime)"; if ( !empty($user['MonitorIds']) ) { - $monFilterSql = ' AND MonitorId IN ('.$user['MonitorIds'].')'; + $monFilterSql = ' AND E.MonitorId IN ('.$user['MonitorIds'].')'; $rangeSql .= $monFilterSql; $eventsSql .= $monFilterSql;