From: Owen Leonard Date: Thu, 21 Oct 2010 20:29:29 +0000 (-0600) Subject: improve filter of companions X-Git-Tag: release_1_1_0~2 X-Git-Url: http://git.pippins.net/embedvideo/.git/%22%22.%24thumbnail.%22/.%24link.?a=commitdiff_plain;h=4c8106c717ade1fb6854922662ff87e7ff262c08;p=eq%2F.git improve filter of companions --- diff --git a/inc/class.tc.inc.php b/inc/class.tc.inc.php index dee205c..883884f 100644 --- a/inc/class.tc.inc.php +++ b/inc/class.tc.inc.php @@ -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');