Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Top ten daily searches...

Quote Reply
Top ten daily searches...
This is based off some code Paul posted a while back. I'm trying to pull a top list from a set of daily searches using the Improved Search Logger plugin. Can someone tell me what I'm doing wrong? I keep getting the error:

Can't call method "fetchrow_hashref" on an undefined value at (eval 369) line 16.

Code:
sub {
# -----------------------------------------------
# Returns a list of the daily Top 10 Searched terms.

# Gets the current date.
Links::init_date();
GT::Date::date_set_format($CFG->{'date_db_format'});
my $date = GT::Date::date_get();

my (@output,$db,$sth);

$db = $DB->table('SearchLogDaily');
$db->select_options ('ORDER BY HitCount DESC', 'WHERE Hit_Date = \"$date\"', 'LIMIT 10');
$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('<br>', @output) : 'No terms yet!';

}

Thanks upfront...

Sean
Subject Author Views Date
Thread Top ten daily searches... SeanP 2550 Sep 26, 2002, 11:58 AM
Thread Re: [SeanP] Top ten daily searches...
Paul 2468 Sep 26, 2002, 12:05 PM
Thread Re: [Paul] Top ten daily searches...
SeanP 2467 Sep 26, 2002, 12:13 PM
Thread Re: [SeanP] Top ten daily searches...
Paul 2440 Sep 26, 2002, 1:07 PM
Thread Re: [Paul] Top ten daily searches...
SeanP 2440 Sep 26, 2002, 1:43 PM
Thread Re: [SeanP] Top ten daily searches...
Paul 2437 Sep 26, 2002, 2:01 PM
Post Re: [Paul] Top ten daily searches...
SeanP 2428 Sep 26, 2002, 4:33 PM