From f7cd4ca179c0aaa2f525614d86ec74c5e56f10b7 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sun, 7 Jan 2018 14:42:34 +0100 Subject: [PATCH] Fixed issue --- classes/components/conversations.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/classes/components/conversations.php b/classes/components/conversations.php index a9c54bd..357d19a 100644 --- a/classes/components/conversations.php +++ b/classes/components/conversations.php @@ -383,12 +383,14 @@ class conversations { //Prepare database request $tableName = $this->conversationsUsersTable." AS table1 JOIN ". - $this->conversationsUsersTable." AS table2"; + $this->conversationsUsersTable." AS table2 JOIN ". + $this->conversationsUsersTable." AS table3"; //Prepare conditions - $joinCondition = "table1.ID_".$this->conversationsListTable." = table2.ID_".$this->conversationsListTable; - $whereConditions = "table1.ID_utilisateurs = ? OR table1.ID_utilisateurs = ?"; - $groupCondition = "table1.ID_".$this->conversationsListTable." having count(*) = 4"; + $joinCondition = "(table1.ID_".$this->conversationsListTable." = table2.ID_".$this->conversationsListTable.")". + "AND (table1.ID_".$this->conversationsListTable." = table3.ID_".$this->conversationsListTable.")"; + $whereConditions = "table1.ID_utilisateurs = ? AND table2.ID_utilisateurs = ?"; + $groupCondition = "table1.ID_".$this->conversationsListTable." having count(*) = 2"; //Conditions values $condValues = array($user1, $user2);