Try the following:
my $sth = $cat->select;
while (my $category = $sth->fetchrow_hashref) {
my $hc = ($cat->count( { FatherID => $category->{ID} } )) ? 'Yes' : 'No';
$cat->update( { haschildren => $hc }, { ID => $category->{ID} } );
}
Ivan
-----
Iyengar Yoga Resources / GT Plugins
Code:
my $cat = $DB->table('Categories'); my $sth = $cat->select;
while (my $category = $sth->fetchrow_hashref) {
my $hc = ($cat->count( { FatherID => $category->{ID} } )) ? 'Yes' : 'No';
$cat->update( { haschildren => $hc }, { ID => $category->{ID} } );
}
Ivan
-----
Iyengar Yoga Resources / GT Plugins