I want to refresh the page when my database changes. I want to use jquery for this. The question is not clear? Then take a look at this, suppose this is my page:
<?php $query=mysql_query("select * from tbl1 where user='admin'"); if(mysql_num_rows?($query)!=0) { echo 'Table 1 has values'; } else { echo 'Table1 is empty'; } ?>
This action should be performed whenever any new record is added to the database. Now suppose I add a record to the database manually, then the page should automatically show the result as "Table1 has values." I know that it can be used using the periodic update page, but I do not want to use it. Instead, I want to try something else, such as an ajax poll? Can someone give me a demo?
source share