Gossamer Forum
Home : Products : DBMan SQL : Discussion :

problem with global function

Quote Reply
problem with global function

in a detailed record view i would like to show a list of related records of another table. I want to do this using a global definition.

This is my code.


sub {
my $tags = shift;
my $db = $tags->{db};
my $id = $tags->{ID};
my $table = $DB->table('sreviews');
$table->select_options ('ORDER BY create_date', 'LIMIT 5');
my $sth = $table->query({ reviewd_id => $id} );
if ($sth) {
my @output;
while (my $row = $sth->fetchrow_hashref) {
push (@output, $row);
return {rev_loop => \@output };


In the detailed template I use

<%loop rev_loop%> <%sreview_id%>: <%review%><br><%endloop%>

But i get this error message:
Can't call method "fetchall_arrayref" on an undefined value at c:/home/henning/test/cgi-bin/dbsql201/admin/GT/SQL/Table.pm line 683.

What am I doing wrong?

Thanks for your help!


Subject Author Views Date
Thread problem with global function ktt 2250 Nov 3, 2001, 12:17 PM
Post Re: [ktt] problem with global function
Alex 2162 Nov 3, 2001, 12:38 PM