SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member bluebox39's Avatar
    Join Date
    Aug 2004
    Location
    Lagos, Nigeria
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Can MySQL be used to create a 'hit-counter' on a web site?

    Is it possible to have a hit counter on a web site powered by MySQL database. How is this possible? Thanks

  2. #2
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Sure it can. The design of it just depends on what kind of information you are wanting to capture. If you just want to get the total number of hits on your website then you could have a table with just 1 column and 1 row:

    Code:
    create table counter (
    hits int(7) not null
    )
    Then in your PHP you would check to see that a person is visiting for the first time and update the number in that field by 1.


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
  •