hi
I have created in the table Links a new field called "FAQ"
On the category page where links are displayed according the value of the field FAQ
I have creted this sub
sub {
my $vars = shift;
my $cat = $vars->{ID};
my $db = $DB->table('CatLinks','Links');
my (@output, $sth);
my $sth = $db->select ({ CategoryID => '17'});
while (my $hash = $sth->fetchrow_hashref) {
push @output, $hash;
}
return \@output;
}
And it works when a fix value of CategoryID.
my $sth = $db->select ({ CategoryID => '17'});
Whereas if I change in
my $sth = $db->select ({ CategoryID => $cat});
or
my $sth = $db->select ({ CategoryID => $vars->{ID}});
it does not work
What is the trouble?
I have created in the table Links a new field called "FAQ"
On the category page where links are displayed according the value of the field FAQ
I have creted this sub
sub {
my $vars = shift;
my $cat = $vars->{ID};
my $db = $DB->table('CatLinks','Links');
my (@output, $sth);
my $sth = $db->select ({ CategoryID => '17'});
while (my $hash = $sth->fetchrow_hashref) {
push @output, $hash;
}
return \@output;
}
And it works when a fix value of CategoryID.
my $sth = $db->select ({ CategoryID => '17'});
Whereas if I change in
my $sth = $db->select ({ CategoryID => $cat});
or
my $sth = $db->select ({ CategoryID => $vars->{ID}});
it does not work
What is the trouble?