undefined Id in Php and need help to fix
Posted: Sat Aug 29, 2009 1:34 pm
Does anyone know what I need to change to get this working? Note the "undefined" variable (Id) getting passed around.
From main window:
1) click on any camera's event (I clicked on Hour "3")
- this brings up the listing of events for that filter
2) click on any event Id
- this brings up and plays back the video for that event
3) click on Video
This error is then displayed in the popup window:
An error has occurred and this operation cannot continue.
For full details check your web logs for the code '660259'
This is from the /var/log/http/error_log
This error is generated from the file ajax/event.php
This line:
This is a portion of the HTML page which showed the video and the html link Video that I clicked on:
I am running ZM 1.23.3 (fresh install from this past week). I am running CentOs 5.3 (fresh install from this past week).
# uname -a
Linux dvr 2.6.18-128.7.1.el5 #1 SMP Mon Aug 24 08:20:55 EDT 2009 i686 i686 i386 GNU/Linux
# mysql --version
mysql Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu (i686) using readline 5.0
[root@dvr ~]# php --version
PHP 5.1.6 (cli) (built: Apr 7 2009 08:00:04)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
[root@dvr ~]# perl --version
This is perl, v5.8.8 built for i386-linux-thread-multi
From main window:
1) click on any camera's event (I clicked on Hour "3")
- this brings up the listing of events for that filter
2) click on any event Id
- this brings up and plays back the video for that event
3) click on Video
This error is then displayed in the popup window:
An error has occurred and this operation cannot continue.
For full details check your web logs for the code '660259'
This is from the /var/log/http/error_log
[Sat Aug 29 07:55:36 2009] [error] [client 192.168.202.230] SQL-ERROR(62D88F): select Events.Id as Id, MonitorId, Name, Cause, StartTime, date_format( StartTime, '%y/%m/%d %H:%i:%S' ) as StartTimeShort, EndTime, Width, Height, Length, Frames, AlarmFrames, TotScore, AvgScore, MaxScore, Archived, Videoed, Uploaded, Emailed, Messaged, Executed, Notes, min(Frames.FrameId) as MinFrameId, max(Frames.FrameId) as MaxFrameId, min(Frames.Delta) as MinFrameDelta, max(Frames.Delta) as MaxFrameDelta from Events left join Frames on Events.Id = Frames.EventId where Events.Id = undefined group by Frames.EventId limit 1, referer: http://192.168.202.7/zm/?view=event&eid ... c=1&page=1
[Sat Aug 29 07:55:36 2009] [error] [client 192.168.202.230] SQL-ERROR(62D88F): Unknown column 'undefined' in 'where clause', referer: http://192.168.202.7/zm/?view=event&eid ... c=1&page=1
[Sat Aug 29 07:57:02 2009] [error] [client 192.168.202.230] SQL-ERROR(660259): select E.*,M.Name as MonitorName,M.Width,M.Height,M.DefaultRate,M.DefaultScale from Events as E inner join Monitors as M on E.MonitorId = M.Id where E.Id = undefined, referer: http://192.168.202.7/zm/?view=event&eid ... c=1&page=1
[Sat Aug 29 07:57:02 2009] [error] [client 192.168.202.230] SQL-ERROR(660259): Unknown column 'undefined' in 'where clause', referer: http://192.168.202.7/zm/?view=event&eid ... c=1&page=1
This error is generated from the file ajax/event.php
This line:
Code: Select all
$sql = "select E.*,M.Name as MonitorName,M.DefaultRate,M.DefaultScale from Events as E inner join Monitors as M on E.MonitorId = M.Id where E.Id = ".dbEscape($_REQUEST['id']).monitorLimitSql();
Code: Select all
//
// PHP variables to JS
//
var connKey = '638597';
var event = {
Id: 1841,
Width: 320,
Height: 240,
Length: 1.00};
var filterQuery = '&filter[terms][0][attr]=Archived&filter[terms][0][op]=%3D&filter[terms][0][val]=0&filter[terms][1][cnj]=and&filter[terms][1][attr]=DateTime&filter[terms][1][op]=%3E%3D&filter[terms][1][val]=-1+hour&filter[terms][2][cnj]=and&filter[terms][2][attr]=MonitorId&filter[terms][2][op]=%3D&filter[terms][2][val]=1';
var sortQuery = '&sort_field=StartTime&sort_asc=1';
var scale = 100;
var canEditEvents = true;
var streamTimeout = 3000;
var canStreamNative = false;
//
// Strings
//
var deleteString = "Delete";
var causeString = "Cause";
# uname -a
Linux dvr 2.6.18-128.7.1.el5 #1 SMP Mon Aug 24 08:20:55 EDT 2009 i686 i686 i386 GNU/Linux
# mysql --version
mysql Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu (i686) using readline 5.0
[root@dvr ~]# php --version
PHP 5.1.6 (cli) (built: Apr 7 2009 08:00:04)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
[root@dvr ~]# perl --version
This is perl, v5.8.8 built for i386-linux-thread-multi