How to alert if another data added to the database? in this case everysecond there is an alert how can i apply this to have a notification when another data is fetched.
$(document).ready(function() {
setInterval(function() {
$.get('functions/today_sched.php', function (data) {
$('#today').html(data);
alert('change')
});
}, 1000);
});
HTML
<div id = "today"></div>
today_sched.php
<?php
$con = mysqli_connect("localhost","root","","schedule");
$date = date("d/m/Y");
$count=1;
$sel_query="Select * from today_schedule where date = '$date'";
$result = mysqli_query($con,$sel_query);
while($row = mysqli_fetch_assoc($result)) {
<tr>
<td>echo $row['date'];</td>
</tr>
$count++;
}
?>