Dream
03-03-2007, 01:39 AM
What would the query be, I want to get how many posts a list of days got starting from today and going back X days. An example of what the list would be
Day Posts
3/3 29
3/2 17
3/1 33
2/28 39
2/27 17
I was able to create a list of timestamps for the days I want to get, but stopped on the query.
// make list of days timestamps
$timestamps = array();
$day = getdate();
$day = mktime(0, 0, 0, $today['mon'], $today['mday'], $today['year']); //gets today timestamp
for ($i = 1; $i <= $how_many; $i++) {
$timestamps[] = $day;
$day -= 86400; //86400 is how many seconds a day has
}
Day Posts
3/3 29
3/2 17
3/1 33
2/28 39
2/27 17
I was able to create a list of timestamps for the days I want to get, but stopped on the query.
// make list of days timestamps
$timestamps = array();
$day = getdate();
$day = mktime(0, 0, 0, $today['mon'], $today['mday'], $today['year']); //gets today timestamp
for ($i = 1; $i <= $how_many; $i++) {
$timestamps[] = $day;
$day -= 86400; //86400 is how many seconds a day has
}