FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


how to store statistics in database ?





ixtra
Hi everyone ! Im making a management system in mysql and php to store data of people (like name address , phone , etc) but what I want is to store the statistics of the number of data added per month every month .
How should I do that ?
Currently I use
Code:

  `date` datetime NOT NULL,

in the table structure to store the date using NOW() when the form is filled

What can I do to store statistics ?
pirate
right you need to make like a php registration type thing so it stores the data, have an auto increment id and then echo out the id colum for the number of people
IndirParadise
i think its easier if you use timestamp not date and than you create other attributs like whitch token this formular impressed.
Fire Boar
Comment 1: Irrelevant. Disregard.

Comment 2: Not a bad strategy at all, however a formatted date string is probably better for holding dates: it is not bounded unlike an integer timestamp.

You probably don't need to store the actual statistics. You can do COUNT queries WHERE date is a certain month. For more complicated stuff though (number of updates and deletes as well as inserts, for instance), or to reduce the number of queries if you want to get a lot of months at once, you will need to store statistics. For that I'd suggest a table structure like month/year/number_of_inserts, and just increment this by 1 every time someone adds data. More columns if more statistical data are needed.
ixtra
Thanks everyone for your reply especially to Fire Boar ! Smile
You cleared my doubts I'll try what you have said
Related topics
News management system...
The Best Bioinformatics and Computational Biology database
Need Expert help in php-mysql
Download database.
Urban joined!
Change database collation type
How to avoid reload button rewriting database?
Database transfer
SQL datatype
Storing Files Off Line
What MySQL Data type would you use to store a Webpage
Monthly how many GB you download?
Do you go to record stores?
Storing A Lot of Values Using Sessions
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.