Change this line in Andy's global:
$sth = $link_db->select ( { CategoryID => $cat_id, isNew => 'Yes', isValidated => 'Yes'} );
Edit:
Think you may also need to be using the correct tables
my $link_db = $DB->table('Links','CatLinks');
$sth = $link_db->select ( { CategoryID => $cat_id, isNew => 'Yes', isValidated => 'Yes'} );
Edit:
Think you may also need to be using the correct tables
my $link_db = $DB->table('Links','CatLinks');