Results 1 to 2 of 2
Thread: structure and stament for stats
May 31, 2004, 14:28 #1
- Join Date
- Nov 2002
- Madison, WI USA
- 0 Post(s)
- 0 Thread(s)
structure and stament for stats
I need to build a very simple stats engine for contests that I make. Right now I store information from contests in a table. I can easily find out how many people entered the contest.
However, what would also be neat is to track how many people viewed the contest. So, I thought I would put a php tag on the main page of the contest and it would add a number to the database.
So far, I believe that I need to make a seperate table: Count. The INT collumns for count would be the names of the contest. Each collum would be numerical.
So, here is where I am stuck. How would I add a number to the the collumn in question? Is there and ADD function in Mysql? Do I need to query the database with PHP, add a number, then update the new number?
Or, am I going about this the wrong way?
|contest 1|Contest 2| COntest 3 ...
May 31, 2004, 20:15 #2
Originally Posted by webgodjj
- Join Date
- Jul 2002
- Toronto, Canada
- 59 Post(s)
- 3 Thread(s)
just increment the count directly in the table
update tablename set contestNcount = contestNcount + 1
update tablename set contestcount = contestcount + 1 where contestno = N