Awhile ago TheStone supplied this Global to allow data from unrelated files to be used in templates
sub {
my ($table, $field, $value) = @_;
my $sth = $DB->table($table)->select({ $field => $value });
my @output;
while (my $rs = $sth->fetchrow_hashref ) {
push @output, $rs;
}
return { loop_hash => \@output };
}
It works very well but another requirement has raised it's ugly face and I need to do the same thing but display the items by date, most often the files are not entered in order and this global will just display the output as it finds them in the files.
Or is there another way?
Thanks.....
sub {
my ($table, $field, $value) = @_;
my $sth = $DB->table($table)->select({ $field => $value });
my @output;
while (my $rs = $sth->fetchrow_hashref ) {
push @output, $rs;
}
return { loop_hash => \@output };
}
It works very well but another requirement has raised it's ugly face and I need to do the same thing but display the items by date, most often the files are not entered in order and this global will just display the output as it finds them in the files.
Or is there another way?
Thanks.....