Sort database entries via a dropdown list
Posted
by Lin
on Stack Overflow
See other posts from Stack Overflow
or by Lin
Published on 2010-05-08T21:09:19Z
Indexed on
2010/05/08
22:08 UTC
Read the original article
Hit count: 227
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!
© Stack Overflow or respective owner