How can I always keep my data from the database on a website up to date
I'm currently working on a website that displays data from my database. For information: I use an apache web server, php to provide the data and html css and javascript to implement the front end. I would now like to keep my data on the website up to date. In other words, if the data in the database changes, I want it to change on the website as well. My working solution is as follows: I use JQuery Ajax to call my data from the database every few seconds and compare this with my previously saved values from the ajax call before and if these data do not match, I update my elements on the website. This also works and is great because I can update elements without reloading the website, but the question now arises whether I really have to make an ajax call every second in order to compare the data with the previous call to see a change in data of the database can be identified thank you in advance