Results 1 to 3 of 3

Thread: PHP - Page Counter

  1. #1
    Join Date
    Dec 2007
    Posts
    123
    Thanks
    17
    Thanked 1 Time in 1 Post

    Question PHP - Page Counter

    Hi

    I am trying to create a page counter in PHP.

    Table structure:
    Code:
    Table Name: tbl_counter
    Column Name:total_views
    Column Datatype: integer
    I am using the following SQL query on the page.

    Code:
    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?

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Can we see your whole entire PHP code?
    Jeremy | jfein.net

  3. #3
    Join Date
    Oct 2006
    Posts
    183
    Thanks
    0
    Thanked 11 Times in 11 Posts

    Default

    If the page is reloaded or loaded in an iframe without checking these conditions, it wil update.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •