so i have this controller to run the model function
controller:
public function delete()
{
if ($this->phome_model->delete_expired()) {
$this->session->set_flashdata('pesan', 'Success. Back to '. anchor('program', 'home.', 'class="alert-link"'));
redirect('program/admin/user/sukses');
} else {
$this->session->set_flashdata('pesan_error', 'Error. Back to '. anchor('program', 'home.', 'class="alert-link"'));
redirect('program/admin/user/error');
}
}
And this is the model:
public function delete_expired()
{
$this->db->where('YEAR(CURDATE()) - YEAR(Tanggal_Periksa_History) >=', 5);
$this->db->delete('tb_medical_history');
$this->db->where('YEAR(CURDATE()) - YEAR(Tanggal_Periksa_Fisik) >=', 5);
$this->db->delete('tb_fisik_jiwa');
$this->db->where('YEAR(CURDATE()) - YEAR(Tanggal_Periksa_Radiologi) >=', 5);
$this->db->delete('tb_radiologi');
$this->db->where('YEAR(CURDATE()) - YEAR(Tanggal_Periksa_Lab) >=', 5);
return $this->db->delete('tb_laboratorium');
}
what i'm trying to do here is delete those multiple tables where the data is expired (5 years late). on the model function, i need to check if the data on each table is deleted successfuly using the return function and pass it to controller to show the message. but function can have only 1 return, so what do i do to fix this? thanks