Hi all,
If I have posted this in the wrong forum then my apologies.
I just can't figure the logic or how to do this in my head.
Basically I have a table of product downloads. This table holds all the data for all the product downloads available.
What I wish to do is to display on a page the latest release for each product. So rather than getting a full list of all the releases just get the latest version for each product and diplay them in a list.
So for instance there could be 5 Product A downloads and 3 Product B downloads. I want to select the latest download for both Product A and Product B and list them.
Product A Release 01/07/04
Product B Release 25/06/04
Do I make sense?
Hope someone can give me some sort of inspiration, my mind has turned to mush now.
Show latest release of software download
Moderator: General Moderators
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
Ahhh fantastic. And here I was thinking of some complex loop.
So how would I build the SQL statement so I can display the title of these records etc.
For instance if I did this:
It would select the unique Products, titles etc. How do I do the DISTINCT selection but still get accesss to the other fields?
So how would I build the SQL statement so I can display the title of these records etc.
For instance if I did this:
Code: Select all
$sql = "SELECT DISTINCT product, title, DATE_FORMAT(release_date,'%d/%m/%Y') as formatted_release_date FROM downloads ORDER BY release_date";