i have a simple table with a few columns. I am updating a view count in the database, but the problem is that I am making some ajax calls every 20 seconds. I just want to count the page views, but the AJAX calls are also also being counted as views.
My code is very simple.
$res = sql_query("select * from tableA where user='XYZ'");
sql_query("update tableA set views=views+1 ");
This does the job, but due to AJAX it keeps on increasing the views count in the database. Can anyone help me so that I can count only actual views, not the AJAX calls?
You can try this: