ipwnzphp Posted February 9, 2007 Share Posted February 9, 2007 Hello, i have the dates stored in my database and all but how would i show the stats by month. like Jan to Feb every month it just shows the stats for that month. How would i make my stats do this? Thanks Amy Link to comment https://forums.phpfreaks.com/topic/37734-monthly-stats-how-do-i-show-them/ Share on other sites More sharing options...
tauchai83 Posted February 9, 2007 Share Posted February 9, 2007 well, i'm not sure what do you want. But it is a very simple way. you offer a user two date range to select from. name it as $date1 and $date2. then use SQL to do the query "SELECT * FROM your_table WHERE date BETWEEN $date1 AND $date2"; you may add wherever necessary. I guess you are doing report. regards, chai Link to comment https://forums.phpfreaks.com/topic/37734-monthly-stats-how-do-i-show-them/#findComment-180545 Share on other sites More sharing options...
JasonLewis Posted February 9, 2007 Share Posted February 9, 2007 well it also depends on how you've inserted the dates into the database. if you have a date column it would be easy. Link to comment https://forums.phpfreaks.com/topic/37734-monthly-stats-how-do-i-show-them/#findComment-180558 Share on other sites More sharing options...
ipwnzphp Posted February 9, 2007 Author Share Posted February 9, 2007 um. ok. Link to comment https://forums.phpfreaks.com/topic/37734-monthly-stats-how-do-i-show-them/#findComment-181079 Share on other sites More sharing options...
ipwnzphp Posted February 9, 2007 Author Share Posted February 9, 2007 well, i'm not sure what do you want. But it is a very simple way. you offer a user two date range to select from. name it as $date1 and $date2. then use SQL to do the query "SELECT * FROM your_table WHERE date BETWEEN $date1 AND $date2"; you may add wherever necessary. I guess you are doing report. regards, chai you offer a user two date range to select from. what do you mean? Link to comment https://forums.phpfreaks.com/topic/37734-monthly-stats-how-do-i-show-them/#findComment-181081 Share on other sites More sharing options...
tauchai83 Posted February 9, 2007 Share Posted February 9, 2007 meaning you offer a drop down box for use to select day, month and year respectively. date will become $year.-.$month.-.$day (eg, 2007-02-10)...what data type you put in your DB for date field? Link to comment https://forums.phpfreaks.com/topic/37734-monthly-stats-how-do-i-show-them/#findComment-181104 Share on other sites More sharing options...
ipwnzphp Posted February 9, 2007 Author Share Posted February 9, 2007 meaning you offer a drop down box for use to select day, month and year respectively. date will become $year.-.$month.-.$day (eg, 2007-02-10)...what data type you put in your DB for date field? using the date function date("Y-m-d"); Link to comment https://forums.phpfreaks.com/topic/37734-monthly-stats-how-do-i-show-them/#findComment-181119 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.