Hello, I have to check in the database if a logged in user already has cpf registered and return whether it is false or not.
I use the codeigniter in the application. I'll send the codes. CONTROLLER:
public function check_cpf_doctor() {
$check_result = $this->Doctor_model->checkCPFDoctor($_POST['doctor_id']);
print json_encode($check_result);
}
// DOCTOR_MODEL
public function checkCPFDoctor($id)
{
$key = $this->config->item('encryption_key');
$query =
if($query['crm'])
{
return true;
}
else
{
return false;
}
}
This model query is wrong and incomplete because I could not finish it, I want it to return the data of the user that is logged in.