astralaaron Posted August 28, 2008 Share Posted August 28, 2008 I need to be able to out put the number of entries into mysql for the current day, does anyone have a good idea how to do that? Link to comment Share on other sites More sharing options...
boen_robot Posted August 28, 2008 Share Posted August 28, 2008 Keep track on the time of modification (as a DATETIME field in the tables in question), and make a query that selects entries on that date range. You can get the number of entries fetched from PHP itself. If you aren't going to use the data itself, but just want the number, then I think there may be a function in SQL that would return only that in a single column. I don't know which one exactly though. Try to search in the MySQL (or whatever) documentation for this. Link to comment Share on other sites More sharing options...
astralaaron Posted August 28, 2008 Author Share Posted August 28, 2008 Keep track on the time of modification (as a DATETIME field in the tables in question), and make a query that selects entries on that date range. You can get the number of entries fetched from PHP itself. If you aren't going to use the data itself, but just want the number, then I think there may be a function in SQL that would return only that in a single column. I don't know which one exactly though. Try to search in the MySQL (or whatever) documentation for this.there are so many ways to store the date/time thats the thing that is confusing me.. should I use a time stamp? or MySQL's now() ?? Link to comment Share on other sites More sharing options...
justsomeguy Posted August 28, 2008 Share Posted August 28, 2008 I prefer to use an integer field and PHP's time function. Link to comment Share on other sites More sharing options...
astralaaron Posted August 29, 2008 Author Share Posted August 29, 2008 I prefer to use an integer field and PHP's time function.then how would you go about outputting the # of entries for the current day? Link to comment Share on other sites More sharing options...
justsomeguy Posted August 29, 2008 Share Posted August 29, 2008 You figure out the range of numbers that fall in the current day and select entries in that range. You can use mktime to get the value for a specific time and date. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.