I've tried to incorporate this code, but couldn't get it working. If you could, would you be able to show me what my new global would be with a "sort by" column and limit of 25 and descending? My current global:
my $tags = GT::Template->tags;
my $id = $tags->{ID};
my ($table, $field) = @_;
my $sth = $DB->table($table)->select({ $field => $id});
my @output;
while (my $rs = $sth->fetchrow_hashref ) {
push @output, $rs;
}
return { loop_hash => \@output };
}
Thanks for the help.
Code:
sub { my $tags = GT::Template->tags;
my $id = $tags->{ID};
my ($table, $field) = @_;
my $sth = $DB->table($table)->select({ $field => $id});
my @output;
while (my $rs = $sth->fetchrow_hashref ) {
push @output, $rs;
}
return { loop_hash => \@output };
}
Thanks for the help.