public function verification() { $query = "SELECT `id` FROM `appoinment` WHERE `patient_user`='" . $this->getPatientUser() . "' AND `doctor`='" . $this->getDoctor() . "' AND `date`='" . $this->getDate() . "' AND `time`='" . $this->getTime() . "' AND `is_approved`='1'"; $result = $this->db->query(" SELECT * FROM `appointment` "); if ($result->num_rows >= 0) { self::$message = "Appointment registered you will inform soon"; return true; //is empty } else { self::$message = 'An appointment with this doctor of same time has been already registred!'; return false; } }