improve filter of companions
authorOwen Leonard <owen@balawis.leonard.fam>
Thu, 21 Oct 2010 20:29:29 +0000 (14:29 -0600)
committerOwen Leonard <owen@balawis.leonard.fam>
Thu, 21 Oct 2010 20:29:29 +0000 (14:29 -0600)
inc/class.tc.inc.php

index dee205c5ed178e6d8682324c09da8fc66fa35595..883884f76abfc8aab0ca4e2d608ac592f5e28a1f 100644 (file)
@@ -544,7 +544,7 @@ class tc
                                $this->db2->query($sql,__LINE__,__FILE__);
                                $companionship_sandbox = mysql_insert_id();
                                
-                               $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";
                                $this->db2->query($sql,__LINE__,__FILE__);
                                while ($this->db2->next_record()) {
                                        $individual = $this->db2->f('individual');