try this version of code that is using mysqli, the same way as a stand alone in /var/www/html and see if it works!!
set $which_monitor to your monitor id.
Finally this works, a bit strange that this works without a username and password but this is because the file belongs to root i guess.
I am glad that this works so I can use it on my website.
Now i have to find out how to show the events of today edit the mysqli_query with StartTime and EndTime i think
Thanks
Nice! if you would like to secure the php file you can try and move the php program to the WordPress site root and add this to the top of the php code directly after the <?php
I have the PHP file on the zoneminder server and an Iframe on the Wordpress website because this is another server.
It just now show the traffic counter of the last 5 day's i am investigate how to show only the counter of today, because there is no table in the database with hold this data, so i have to filter it with StartTime and EndTime
I changed the query a bit:
if ($result = mysqli_query($link, "SELECT * FROM `Events` WHERE `MonitorId`=$which_monitor AND `StartTime` >= DATE_SUB(CURDATE(), INTERVAL 0 DAY)"))
Now I can count the traffic for this date, with the other statement NOW() and interval of 24 HOUR the value changed every minute when time goes by.
The script works 100% and the counting is very accurate, but this brings me to a new challenge.
I want count cars and bikes with the same camera, so i made two zones named cars and bikes, but I can't find in the database where it store these names of the zones when they are triggered.
I understand. There is a way using the Darknet neural network and YOLO to examine a few of the Alarm frames and let it identify what is in the selected frame. I have managed to do this but it is not really practical as of yet. Uses a lot of CPU resources and the zone method you are looking to work with may do the trick. Can you show us the Zone(s) setup you propose to use? I will track down some more info on this as I am still working on using the zones to track a train traveling on a set of tracks and identify whether the train is traveling left to right or right to left.
P.S. what was the link to the event counter and the village website?
Hi.
I just have two small zones one called Cars and one called Pedestrians to try count both separated.
Searched the database for the names of the zones but can't find them so I think Zoneminder does nothing with the names but working with an #ID or something.