Here is a snippet of the script I am using to fetch record in the database.
var url = '../waitOrders?restaurant_id=1;
$(document).ready(function() {
$.ajaxSetup({ cache: false });
setInterval(function() {$("#displayarea").load(url); }, 400);
});
It works fine but my question is that is there a way to notify me that the database has a new record or changes?