I have the following code
# returns a legend image to know what are we browsing (Links, Files etc)
# node_id is the Category, what we need is to determine WHAT is in that category, so we query the
# cateogory DB, get NumLinks and then begin to check: Features, File, Detailed and Regular, depending
# of the result
my $lid = shift;
my $catego = $DB->table('Category');
my $sth_loop = $catego->select ( { ID => $lid } );
my $row = $sth_loop->fetchrow_hashref;
my $numlinks = "$row->{Number_Of_Links}";
my $image = $numlinks . 'cart.gif';
my $output = "<img width=18 height=16 border=0 src=$CFG->{build_images_url}/$image>";
return $output;
}
It takes an argument, then it should do a database operation and return another... I've tried to debug this, and the ONLY value that I can return succesfully is the value I get as an argument why???
Code:
sub node_whatis { # returns a legend image to know what are we browsing (Links, Files etc)
# node_id is the Category, what we need is to determine WHAT is in that category, so we query the
# cateogory DB, get NumLinks and then begin to check: Features, File, Detailed and Regular, depending
# of the result
my $lid = shift;
my $catego = $DB->table('Category');
my $sth_loop = $catego->select ( { ID => $lid } );
my $row = $sth_loop->fetchrow_hashref;
my $numlinks = "$row->{Number_Of_Links}";
my $image = $numlinks . 'cart.gif';
my $output = "<img width=18 height=16 border=0 src=$CFG->{build_images_url}/$image>";
return $output;
}
It takes an argument, then it should do a database operation and return another... I've tried to debug this, and the ONLY value that I can return succesfully is the value I get as an argument why???