I am trying to create a system for Cron to execute a PHP file every 2 hours, and check if there was any record inserted in a certain table, if there are new records, know the total amount of new records in the meantime.
The only approach I thought was to query a COUNT , save the amount of records in a new table, and then execute the query that will send the notification if it has new records.
The question is: Is this approach ideal? Is something easier or even more correct?