Welcome Guest, Not a member yet? Register   Sign In
Most Searches in a Day
#2

[eluser]richthegeek[/eluser]
I think this might be too complicated to do it with pure SQL, but I'm sure some SQL guru will disagree with me here...

Read the db into a PHP array.

Create a second array called "searchDays" or w/e

For each row, could divide the timestamp by 86400 and round it to give you a "number of days since unix epoch" instead of number of seconds.

Increment searchDays[ timestamp ] by 1, and you will end up with an array where the key is eqaul to the number of days, and the value equivalent to the number of searches on that day.

ksort() the array to make the most active day appear the top and then use current() to grab the first array element, and then use key() to get the timestamp.

Finally, multiply the timestamp by 86400 to get back to a UNIX timestamp and use date() to format as you wish.


Messages In This Thread
Most Searches in a Day - by El Forum - 09-24-2008, 01:41 PM
Most Searches in a Day - by El Forum - 09-24-2008, 03:01 PM
Most Searches in a Day - by El Forum - 09-24-2008, 03:04 PM
Most Searches in a Day - by El Forum - 09-24-2008, 03:07 PM
Most Searches in a Day - by El Forum - 09-24-2008, 03:09 PM
Most Searches in a Day - by El Forum - 09-24-2008, 03:09 PM
Most Searches in a Day - by El Forum - 09-24-2008, 06:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB