- $sth = $dbh->prepare("update eq_companionship set district='$district' where elder='$elder'");
- $sth->execute or die "-E- DB error: $DBI::errstr\n";
- $sth = $dbh->prepare("update eq_companionship set companionship='$id' where elder='$elder'");
- $sth->execute or die "-E- DB error: $DBI::errstr\n";
- $sth = $dbh->prepare("update eq_companionship set valid=1 where elder='$elder'");
- $sth->execute or die "-E- DB error: $DBI::errstr\n";
+ $sth = $dbh->prepare("update eq_companionship set district='$district' where elder='$elder' and companionship='$id'");
+ $sth->execute or die "-E- DB error 'district': $DBI::errstr\n";
+ $sth = $dbh->prepare("update eq_companionship set elder='$elder' where elder='$elder' and companionship='$id'");
+ $sth->execute or die "-E- DB error 'elder': $DBI::errstr\n";
+ $sth = $dbh->prepare("update eq_companionship set valid=1 where elder='$elder' and companionship='$id'");
+ $sth->execute or die "-E- DB error 'valid': $DBI::errstr\n";