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 Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
ipwnzphp Posted February 9, 2007 Author Share Posted February 9, 2007 um. ok. Quote Link to comment 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? Quote Link to comment 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? Quote Link to comment 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"); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.