Sort database entries via a dropdown list
- by Lin
Hello!
I'm curious if anyone could possibly help me, because I can't find anything exactly related to it anywhere, and it's driving me nuts.
I'd like to have a dropdown list on a page, that will give the visitor the option to sort all entries by year. I have entries from i.e. 2001, 2005, 2009, 2010. The years should be displayed in the dropdown, so the visitor can easily just select all entries dated 2001 if they want.
The year for each entry is located in the one database table I have.
In other words, I simply want a "sort by" dropdown that you can see on pretty much any shopping site nowadays. But with set years.
Thanks in advance for any replies!