PDA

View Full Version : PHP - Page Counter


cancer10
08-10-2008, 07:38 AM
Hi

I am trying to create a page counter in PHP.

Table structure:

Table Name: tbl_counter
Column Name:total_views
Column Datatype: integer

I am using the following SQL query on the page.


UPDATE tbl_counter SET total_views=total_views+1

I know its weird but, sometimes the counter increases twice instead of 1, any idea why?

Nile
08-10-2008, 01:58 PM
Can we see your whole entire PHP code?

motormichael12
08-10-2008, 07:14 PM
If the page is reloaded or loaded in an iframe without checking these conditions, it wil update.