I have a field in my database table called viewed, does anybody know a small code that will add up all of the numbers in each viewed field for all entries and display the total? So if one field is 2, one is 3 and one is 1, it will display the total of 6. I need the full php/sql code because i'm not so good with it yet... Can anybody help me? Thank you.
search for something called sum in mysql something like this : $query = "SELECT SUM(viewed) FROM TABLE-NAME";