Hello Andy,
I have a question.
I have a category and four subcategory.
category - sub1 - sub2 - sub3 - sub4
I use this global to obtain the ID of the higher category.
For example, since subcategory 4, I obtain the ID of subcategory 3.
category - sub1 - sub2 -
sub3 -
sub4 Code:
sub {
my $FatherID = shift;
my $sth = $DB->table('Category')->select( { ID => $FatherID } ) || return $GT::SQL::error;
my $Father;
while (my $hit = $sth->fetchrow_hashref) {
$Father = $hit->{ID};
}
$Father ? return $Father : return "Couldnt find a match for ID : $FatherID";
}
My question.
It is possible to obtain the ID of the father 0 (category) since subcategory 4 ?
category - sub1 - sub2 - sub3 -
sub4 Thank you for your assistance.
Mick