Is it possible to have a hit counter on a web site powered by MySQL database. How is this possible? Thanks![]()
| SitePoint Sponsor |
Is it possible to have a hit counter on a web site powered by MySQL database. How is this possible? Thanks![]()
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:
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.Code:create table counter ( hits int(7) not null )
ssegraves [at] gmail.com
On Image Use, Abuse, and Where We're Headed
stephan | XMLHttpRequest Basics
flickr | last.fm | Cogentas, LLC
Bookmarks