function sendEmailToAdmins() { $message = $this->patientName . ' requested an appointment reschedule with ' . $this->doctorName . ' and ' . $this->nurseName . ' on ' . $this->date . ' at ' . $this->time . '.'; $email = new SendEmail(); $query = "\n SELECT *\n FROM users\n WHERE\n user_type_id = :type_id\n "; $query_params = array(':type_id' => '4'); try { $stmt = $this->db->prepare($query); $result = $stmt->execute($query_params); } catch (Exception $ex) { } $to = array(); while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { array_push($to, $row['email']); } return $email->SendEmailToMultipleUsers($to, "Appointment Rescheduled", $message, false); }