Hi,
Try this modification to Andy's global:
sub {
my $ID = $_[0];
my $table = $DB->table('CatLinks');
my $sth = $table->select( { LinkID => $ID } ) || return "Error: $GT::SQL::error";
my $CatID;
while (my $hit = $sth->fetchrow_hashref) {
$CatID = $hit->{CategoryID};
}
my $table = $DB->table('Category');
my $sth = $table->select( { ID => $CatID } ) || return "Error: $GT::SQL::error";
my ($FatherID,$Full_Name,$CatIm);
while (my $hit = $sth->fetchrow_hashref) {
$FatherID = $hit->{FatherID};
$Full_Name = $hit->{Full_Name};
$CatIm = $hit->{Category_Image};
}
return { FatherID => $FatherID, Full_Name => $Full_Name, $CatIm => $CatIm }
}
Try this modification to Andy's global:
sub {
my $ID = $_[0];
my $table = $DB->table('CatLinks');
my $sth = $table->select( { LinkID => $ID } ) || return "Error: $GT::SQL::error";
my $CatID;
while (my $hit = $sth->fetchrow_hashref) {
$CatID = $hit->{CategoryID};
}
my $table = $DB->table('Category');
my $sth = $table->select( { ID => $CatID } ) || return "Error: $GT::SQL::error";
my ($FatherID,$Full_Name,$CatIm);
while (my $hit = $sth->fetchrow_hashref) {
$FatherID = $hit->{FatherID};
$Full_Name = $hit->{Full_Name};
$CatIm = $hit->{Category_Image};
}
return { FatherID => $FatherID, Full_Name => $Full_Name, $CatIm => $CatIm }
}