my $rows = scalar @data;
if($rows == 0) {
# No existing records found for this companionship, make a new entry
- print " Adding Elder to companionship: $elder_name -> $id\n";
+ print " Adding Companion to companionship: $elder_name -> $id\n";
$sth = $dbh->prepare("insert into eq_companionship values ($id,'$elder','$aaronic','$district',1)");
$sth->execute or die "-E- DB error: $DBI::errstr\n";
} else {
# Set all records to be invalid. Only mark them as valid if they appear on the new list.
$sth = $dbh->prepare("update eq_family set valid=0");
$sth->execute or die "-E- DB error: $DBI::errstr\n";
+ $sth = $dbh->prepare("update eq_family set companionship=0");
+ $sth->execute or die "-E- DB error: $DBI::errstr\n";
foreach $index (keys %membership_data)
{