Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Total Hits SQL Command

Quote Reply
Total Hits SQL Command
Hi-

I like to keep track of the total amount of hits my site generates each day. I'm a real beginner with MySQL - does anyone know the command that I could put into the SQL Monitor that would provide the sum of the field "Hits" within the Links database? Any help would be greatly appreciated!

-Rover

Quote Reply
Re: Total Hits SQL Command In reply to
SELECT COUNT(Hits)
FROM Links
WHERE (Hits <> 0)

Regards,

Eliot Lee
Quote Reply
Re: Total Hits SQL Command In reply to
Thanks very much Eliot. I tried your command, and found that it should use SUM rather than COUNT to get the actual total number of hits. Your response made it easy for me to see how the basic syntax should go and now it works like a charm. Thanks again.

-Rover