[RESOLVED] Help needed with Querying and Printing one of same named item
Hi
I am trying to figure out how to print one of same-named pieces of software from my database. I'll explain further.
I have a list of software to show people what has been recently updated.
For example in my database I have the following columns.
id, name, version, link, description, dateadded, category
and this is my code to query and print the records:
PHP Code:
$query=("SELECT * FROM software ORDER BY name ASC");
$result=mysql_query($query) or die('Sorry, could not get software at this time '.mysql_error());
while($row=mysql_fetch_array($result)) {
$id=$row['id'];
$name=$row['name'];
$version=$row['version'];
$link=$row['link'];
$description=$row['description'];
$dateadded=$row['dateadded'];
$category=$row['category'];
echo "<div id=\"softwaredistro_page_main\">";
echo "$name" . " <a href=\"singlesoftwarepiece.inc.php?id=$id&name=$name&version=$version&url=$link&description=$description&category=$category\"/>go</a>" . "<br>";
}
This code works well to print out my records. Now here is the problem. I have some pieces of software that have been updated and entered into my database a two or three times so I end up with:
(For example):
Calibre
Evolution
Evolution
Opera Web Browser
Opera Web Browser
And so on...
How do I query, if it is done in the query, obtain only the most recently updated version of a piece of software so I end up with:
Calibre
Evolution
Opera Web Browser
And so on...
I want to keep all versions, so deleting an old one is not something I want o do.
And, lastly, I did try to use LIMIT clause in my query with no success. Otherwise, I am just stumped.
Thanks in advance,
Randy