Hi,
I have a news system on my site running on php/mysql and want to be able to list news articles by the date they are posted.
I want a list box containing all the available dates. The user would select the date they want, click submit and be able to view the list of articles for that date.
I have the list box setup which gets its values from the database and a simple form to pass on the chosen date but at the moment there are multiple instances of the same date appearing in the list box.
(To simplify this example I’m just using 1 digit dates)
The database contains the dates: 1,1,1,1,1,2,2,3,3,3,3,3,4,5,5,6,7.
I want the list box to show 1,2,3,4,5,6,7
I have found examples of how to remove duplicate entries directly from the database, but that’s not what I want.
Can anybody suggest a way to prune out duplicate values?
Many Thanks
I have a news system on my site running on php/mysql and want to be able to list news articles by the date they are posted.
I want a list box containing all the available dates. The user would select the date they want, click submit and be able to view the list of articles for that date.
I have the list box setup which gets its values from the database and a simple form to pass on the chosen date but at the moment there are multiple instances of the same date appearing in the list box.
(To simplify this example I’m just using 1 digit dates)
The database contains the dates: 1,1,1,1,1,2,2,3,3,3,3,3,4,5,5,6,7.
I want the list box to show 1,2,3,4,5,6,7
I have found examples of how to remove duplicate entries directly from the database, but that’s not what I want.
Can anybody suggest a way to prune out duplicate values?
Many Thanks