Hi,
I have a problem with the following code/global:
<%set numhits = 100%>
<%set maxhits = 10%>
<%ifnot nh%><%set nh=1%><%endif%>
sub {
my $tags = shift;
my ($output,$sth,$link);
my $db = $DB->table ('Links');
my $nh = $tags->{nh}||10;
my $mh = $tags->{maxhits}||100;
my $offset = ($nh-1) * $mh;
$db->select_options ("ORDER BY Mod_Date DESC", "LIMIT $offset, $mh");
my $sth = $db->select ( { isValidated => 'Yes', isChanged => 'Yes' });
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link', $link);
}
return $output;
}
Error:
Can't call method "fetchrow_hashref" on an undefined value at (eval 24) line 10.
GT::SQL::error = Failed to execute query: 'SELECT * FROM zz_Links WHERE isChanged = ? AND isValidated = ? ORDER BY Mod_Date DESC LIMIT 1.97403111175413e+16, SCALAR(0x85fdcac)' Reason: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SCALAR(0x85fdcac)' at line 1
If I just use "LIMIT 0, 10" - the results are displayed OK
Everything worked perfectly with Links SQL version 2.1.2
Any ideas?
Thanks in advance!
I have a problem with the following code/global:
<%set numhits = 100%>
<%set maxhits = 10%>
<%ifnot nh%><%set nh=1%><%endif%>
sub {
my $tags = shift;
my ($output,$sth,$link);
my $db = $DB->table ('Links');
my $nh = $tags->{nh}||10;
my $mh = $tags->{maxhits}||100;
my $offset = ($nh-1) * $mh;
$db->select_options ("ORDER BY Mod_Date DESC", "LIMIT $offset, $mh");
my $sth = $db->select ( { isValidated => 'Yes', isChanged => 'Yes' });
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link', $link);
}
return $output;
}
Error:
Can't call method "fetchrow_hashref" on an undefined value at (eval 24) line 10.
GT::SQL::error = Failed to execute query: 'SELECT * FROM zz_Links WHERE isChanged = ? AND isValidated = ? ORDER BY Mod_Date DESC LIMIT 1.97403111175413e+16, SCALAR(0x85fdcac)' Reason: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SCALAR(0x85fdcac)' at line 1
If I just use "LIMIT 0, 10" - the results are displayed OK
Everything worked perfectly with Links SQL version 2.1.2

Any ideas?
Thanks in advance!