- $this->db->query("UPDATE eq_appointment set" .
- " family=" . $family .
- " ,elder=" . $elder .
- " ,date='" . $date . "'" .
- " ,time='" . $time . "'" .
- " WHERE appointment=" . $appointment,__LINE__,__FILE__);
-
- // Email the appointment
- $this->email_appt($appointment);
+ //Only perform a database update if we have made a change to this appointment
+ $sql = "SELECT * FROM eq_appointment where " .
+ "appointment='$appointment'" .
+ "and elder='$elder'" .
+ "and family='$family'" .
+ "and date='$date'" .
+ "and time='$time'";
+ $this->db->query($sql,__LINE__,__FILE__);
+ if(!$this->db->next_record()) {
+ $this->db->query("UPDATE eq_appointment set" .
+ " family=" . $family .
+ " ,elder=" . $elder .
+ " ,date='" . $date . "'" .
+ " ,time='" . $time . "'" .
+ " WHERE appointment=" . $appointment,__LINE__,__FILE__);
+
+ // Email the appointment
+ if(($date != "") && ($time != "")) {
+ $this->email_appt($appointment);
+ }
+ }