- $sql = "SELECT * FROM tc_companion WHERE companionship=$companionship AND valid=1";
+ $sql = "SELECT * FROM tc_companion AS tc JOIN tc_individual AS ti WHERE tc.individual=ti.individual AND tc.companionship=$companionship AND tc.valid=1 AND ti.valid=1";