In this coding iam checking the whether email id is present in database.After that i need to change password.
function user_password($input, $serviceName){
$ipJson = json_encode($input);
$updateArray = array(
'email' => $input['email'],
'password' => md5($input['password']),
'user_modified_date' => date('Y-m-d H:i:s'),
);
$this->db->where('email', $input['email']);
$update = $this->db->update('users', $updateArray);
if ($update) {
$data['message'] = 'email id is present';
$status = $this->clamo_lib->return_status('success', $serviceName, $data, $ipJson);
}
else {
$data['message'] = 'Error In Updating Please Check Your Email ID';
$status = $this->clamo_lib->return_status('error', $serviceName, $data, $ipJson);
}
return $status;
}
if email is present in db i need to get "email id is present" message else i need to get "error"message.how i need to check the condition.