From 08625735e968c78f796c4b9668e45b33c148964f Mon Sep 17 00:00:00 2001 From: markjcrane Date: Mon, 18 Jan 2016 15:02:34 -0700 Subject: [PATCH] Update the sql query that lists the assigned users to specific contacts. --- app/contacts/contact_edit.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/contacts/contact_edit.php b/app/contacts/contact_edit.php index 80fbe052b1..835eae922c 100644 --- a/app/contacts/contact_edit.php +++ b/app/contacts/contact_edit.php @@ -285,10 +285,11 @@ else { unset($prep_statement, $sql); //get the users assigned to this contact - $sql = "SELECT * FROM v_contacts as u, v_contact_users as c "; - $sql .= "where u.user_uuid = c.user_uuid "; - $sql .= "and u.domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and u.contact_uuid = '".$contact_uuid."' "; + $sql = "SELECT u.username, u.user_uuid, a.contact_user_uuid FROM v_contacts as c, v_users as u, v_contact_users as a "; + $sql .= "where c.contact_uuid = '".$contact_uuid."' "; + $sql .= "and c.domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "and u.user_uuid = a.user_uuid "; + $sql .= "and c.contact_uuid = a.contact_uuid "; $sql .= "order by u.username asc "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute();