From 99f7275881c76de2cd77be2ced8b06cdd9367105 Mon Sep 17 00:00:00 2001 From: stan Date: Thu, 3 Jul 2003 20:38:51 +0000 Subject: [PATCH] Fixed non-monitor if no events SQL bug. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@586 e3e1d417-86f3-4887-817a-d78f3d33393f --- web/zm_wml.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/zm_wml.php b/web/zm_wml.php index ac0542300..bcf668134 100644 --- a/web/zm_wml.php +++ b/web/zm_wml.php @@ -60,7 +60,7 @@ if ( $view == "console" ) $HTTP_SESSION_VARS[event_reset_time] = "2000-01-01 00:00:00"; $db_now = strftime( "%Y-%m-%d %H:%M:%S" ); - $sql = "select M.*, count(E.Id) as EventCount, count(if(E.StartTime>'$HTTP_SESSION_VARS[event_reset_time]' && E.Archived = 0,1,NULL)) as ResetEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 1 HOUR && E.Archived = 0,1,NULL)) as HourEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 1 DAY && E.Archived = 0,1,NULL)) as DayEventCount from Monitors as M left join Events as E on E.MonitorId = M.Id group by E.MonitorId order by Id"; + $sql = "select M.*, count(E.Id) as EventCount, count(if(E.StartTime>'$HTTP_SESSION_VARS[event_reset_time]' && E.Archived = 0,1,NULL)) as ResetEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 1 HOUR && E.Archived = 0,1,NULL)) as HourEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 1 DAY && E.Archived = 0,1,NULL)) as DayEventCount from Monitors as M left join Events as E on E.MonitorId = M.Id group by M.Id order by M.Id"; $result = mysql_query( $sql ); if ( !$result ) echo mysql_error();