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

Re: [Abusaki] Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9

Quote Reply
Re: [Abusaki] Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9 In reply to
Hi,

All fixed =)

There were a couple of things;

1) Your top_search_terms global was referencing SearchLog, i.e without the 's'
2) Your global needed rewriting, as the fields didn't match up. It not looks like;

Code:
sub {

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

$db = $DB->table('SearchLogs');
$db->select_options ('ORDER BY slog_hits DESC', 'LIMIT 15');
$sth = $db->select;

while (my $row = $sth->fetchrow_hashref) {
push @output, qq~<div style=padding:1><li> <a href="$CFG->{db_cgi_url}/search.cgi?query=$row->{slog_query}">$row->{slog_query}</a></div>~;
}
return $#output > -1 ? join('<br>', @output) : 'No terms yet!';

}

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9 Dorette 4325 Apr 17, 2005, 7:10 AM
Thread Re: [Abusaki] Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9
Dorette 4181 Apr 17, 2005, 7:27 AM
Thread Re: [Abusaki] Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9
pugdog 4215 Apr 18, 2005, 8:33 AM
Thread Re: [pugdog] Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9
Dorette 4194 Apr 18, 2005, 8:45 AM
Thread Re: [Abusaki] Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9
Andy 4187 Apr 18, 2005, 12:28 PM
Thread Re: [Andy] Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9
Dorette 4165 Apr 18, 2005, 7:42 PM
Thread Re: [Abusaki] Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9
Andy 4145 Apr 18, 2005, 11:35 PM
Thread Re: [Andy] Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9
Dorette 4153 Apr 19, 2005, 9:15 AM
Thread Re: [Abusaki] Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9
Dorette 4145 Apr 21, 2005, 4:56 AM
Thread Re: [Abusaki] Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9
brewt 4171 Apr 21, 2005, 4:08 PM
Post Re: [brewt] Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9
Dorette 4105 Apr 21, 2005, 8:56 PM