Hello all,
I need to get a single update from the database, and in need of some help constructing the query.
this is the original idea of the query, but i then thought, why not speed things up and see if i can get it done within the query itself:
$query = mysql_query("SELECT * FROM table")
while ($data = mysql_fetch_array($query)) {
extract($data);
if ($minver <= $_GET['currentversion'] && $maxver >= $_GET['currentversion']) {
echo $update;
}
}
So i thought, would something similar to this work?
SELECT sourcefile,max(version) FROM table WHERE minver>='$_GET['curver']' AND maxver<='$_GET['curver']'
an extra thing would be, if multiple rows are found with the above query how can i make it so that only the row with the highest version column is in the result?
thanks for any replies