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)) {
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.
Use a temporary variable to check is the $name already is used
PHP Code:
$query=("SELECT * FROM software ORDER BY name ASC, version DESC");
$result=mysql_query($query) or die('Sorry, could not get software at this time '.mysql_error());
while($row=mysql_fetch_array($result)) {
Bookmarks