And still needs more explaining ... this is reminding me of my phd . If you want to use more than one variable to measure something it is not at all straightforward. What about if you take the link with the highest rating and if there is more than one, take the one with the most hits?
sub {
my ($output,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ("ORDER BY Rating DESC Hits DESC, LIMIT 1");
$sth = $search_db->select ( {isValidated => 'Yes'});
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link', $link);
}
return $output;
}
sub {
my ($output,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ("ORDER BY Rating DESC Hits DESC, LIMIT 1");
$sth = $search_db->select ( {isValidated => 'Yes'});
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link', $link);
}
return $output;
}