The easiest way to see how to do it is this:
run the query you posted. This will return the highest 'id' where category is $category.
Now you know which 'id' you want.
Now run another query to actually get the row where the id is the id you just got:
In untested code:
// Get the highest id
$sQuery = " SELECT MAX(id) AS id FROM links WHERE category = '$category'";
if (!$rResult = mysql_query($sQuery))
{
// query failed, print the error
//
echo mysql_error();
}
else
{
// query worked, get the highest id
$aRow = mysql_fetch_row($rResult);
$iID = $aRow['id'];
mysql_free_result($rResult);
// Now run a query to get the row that $iID points to
$sQuery = "SELECT * FROM links WHERE id = $iID";
if (!$rResult = mysql_query($sQuery))
{
// query failed, print the error
//
echo mysql_error();
}
else
{
// query worked, print the row
$aRow = mysql_fetch_row($rResult);
echo '<pre>';
print_r($aRow);
echo '</pre>';
mysql_free_result($rResult);
};
};