Here is an example that should work:
# -----------------------------------------------
# Returns a list of the Top5 Searched terms.
my (@output,$db,$sth);
$db = $DB->table('SearchLog');
$db->select_options ('ORDER BY HitCount DESC', 'LIMIT 5');
$sth = $db->select;
while (my $row = $sth->fetchrow_hashref) {
push @output, qq~<a href="$CFG->{db_cgi_url}/search.cgi?query=$row->{Term}">$row->{Term}</a>~;
}
return $#output > -1 ? join('-', @output) || 'No terms yet!';
}
Btw it looks like you are using Links SQL 1.13?
Code:
sub { # -----------------------------------------------
# Returns a list of the Top5 Searched terms.
my (@output,$db,$sth);
$db = $DB->table('SearchLog');
$db->select_options ('ORDER BY HitCount DESC', 'LIMIT 5');
$sth = $db->select;
while (my $row = $sth->fetchrow_hashref) {
push @output, qq~<a href="$CFG->{db_cgi_url}/search.cgi?query=$row->{Term}">$row->{Term}</a>~;
}
return $#output > -1 ? join('-', @output) || 'No terms yet!';
}
Btw it looks like you are using Links SQL 1.13?