mysql between dates function |
[eluser]megabyte[/eluser]
OK, I've succesfully done this, until I figured out it only works if your current date can allow a 10 days to be subtracted. How do you do this so it wouldnt matter what date it was? here's what I got, which is limited if its the first of the 10th of the month or less. Code: function _show_web_stats() I need help, lol. I've searched the net and hit a learning curve here.
[eluser]Jim OHalloran[/eluser]
The strtotime function in PHP is your friend here. Try replacing this... Code: $then = date('Y-m-d', now()); Code: $past = strtotime('-15 days'); Unix timestamps are just an integer representing the number of seconds since midnight, 1 January 1970. This makes date/time manipulation appear easier, because you can just add/subtract the necessary number of seconds, e.g.: Code: $seconds_in_a_day = 60 * 60 * 24; Quote:I need help, lol. I've searched the net and hit a learning curve here.That's what the community is here for Jim.
[eluser]megabyte[/eluser]
Thanks a lot Jim, that function is going to help me out a lot. |
Welcome Guest, Not a member yet? Register Sign In |