I want to know how can I reflect the change on the HTML as soon as the data changes on the database.
I am aware that I could poll the php file with setInterval function to periodically check if database value changed. However I am interested to know if it could be done without the setInterval function?
Presently the app uses jquery library and PHP backend.
thanks for any help in advance.
Based on the comments below and more research Accessing socket.io server via Apache served pages Accessing socket.io server via Apache served pages
I understand I need to have a node package running on my server to work with socket.io or websocket.io. I cannot take the liberty of installing it since I am on a VPS.
Therefore, its best to use Simple long polling example with JavaScript and jQuery as a snippet to my situation