Code:
#!/usr/bin/perl use strict;
use lib 'admin';
use GT::Base;
use Links qw/$IN $DB $CFG $USER/;
Links::init ('admin');
Links::init_user();
local $SIG{__DIE__} = \&Links::fatal;
# set value of $parent
my $parent = 2;
my $child = $DB->table("Category")->children($parent);
# uncommment next line to include parent category in mass update
# push @$child, $parent;
my $obj = GT::SQL::Condition->new(ID => 'IN' => $child);
my $ret = $DB->table("Category")->update({ link_type => 'blue' }, $obj) or die $!;
print $IN->header('text/plain');
print "categories updated successfully\n";
Philip
------------------
Limecat is not pleased.