That's all you need to do. You can simply add or subtract from either the year, month, or day, and it will calculate the new one. Even if the month is 12, it will compensate for it.
I didnt suppose this would work (although it actually seems typical for PHP on a second thought). Its definitely the dirtier solution but probably the more natural over mine. I guess I would recommend it over mine, at least for PHP.
Originally Posted by jonathanbull
I'm using the script to determine which day my website received the most signups.
I loop through each date and count the occurences in the 'day of signup' column in my mySQL table.
It seems however that my table is too large and the script takes forever to load - I've got a feeling there must be a much quicker way of doing this, am I right?
I'd say you could achieve this also with a SQL query, but one would need to know your database scheme for more information.
I havent tested it but I could imagine something like this could work
SELECT signup_date, COUNT(*) FROM my_table GROUP BY signup_date
▌Sitemeer.com - Is your site up?
▌Multi-Location Service Availability Check ● the only with support for HTTPS & IDN