This may very well have been asked before, but I could not find it.
I am building a page for users to browse other user's profiles. My current plan is for the profiles to be displayed in order of when they were last displayed and when they were last online.
So pretty much I give each item which resides in a database an attribute of last_displayed which contains a timestamp of when the profile was last displayed. Once a profile is displayed the timestamp will be updated and it will not be displayed until other profiles with older last_displayed timestamps are displayed.
At the same time there will be a last_online attribute which contains a timestamp of when the profile was last online. This is to show the more recently online users before showing the older users.
Now when actually querying the database for profiles to display I widen the range of last_displayed and last_online until sufficient profiles are found.
I assume this functionality is not unlike that of dating sites.
So my question is this: Is there a better way to dynamically display user profiles?
Thanks for reading if you got this far!