Jump to content

Age based query


jaymc

Recommended Posts

I have a member database, and with that I have a members online list, heres the problem

 

If a member is over 18, I want to display members over 16 first, then when there are no more over 16's, show anyone else (14, 15 year olds etc)

 

So in other words there may be 23 pages of over 16's, then the 24th page will show 14 and 15 year olds

 

How can I make this into a query, as obvious "select * from members where age >= 16" will not show any under 16s on page 24..

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/137172-age-based-query/
Share on other sites

lets say I have these ages

 

14,15,15,16,17,20,23,25,25,26,29,30

 

I want to display them something like this

 

23,17,30,16,26,25,25,20,15,14,15

 

In other words, any age under 16 can never come before an age 16 or over

 

I cant do a subquery because im not displaying all the results in one big list, they will be paginated

Link to comment
https://forums.phpfreaks.com/topic/137172-age-based-query/#findComment-716616
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.