Hi all,
My head is about to explode and I was wondering if anyone has ever found a solution to my problem.

Using MYSQL and PHP I need to gather those people under 5 years of age and break up the ages into 6 month periods whilst keeping a count of how many of each there are.

The database of users is very big and I need the fastest possible calculation.

Any help will be appreciated.

Many thanks

Determine their age in years and months (calculated columns). If you then divide the months by 12 and round it, you will have 0 or 1 indicating a 6 months span. Then group/order your results by those two columns (year and span).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.