<< Error message >>
Severity: Notice
Message: Uninitialized string offset: 0
Filename: controllers
Line Number: 192
This is the error message i encountered. and below are the controller and model files.
// controller file
$user = $this->user_model->getByMail(array('total_mail' => $mail_auth));
if($user = '')
{
$this->load->helper('url');
redirect('/');
}
else if($this->encrypt->decode($user['password']) == $password_auth) // line 192
{
if($user['verified'] == 'N')
{
$this->session->set_flashdata('message', 'Wront inputs.');
$this->load->helper('url');
redirect('/');
}
}
else
{
$this->session->set_flashdata('message', 'Wrong inputs');
$this->load->helper('url');
redirect('/');
}
}
// model file
function getByMail($option)
{
$basic_result = $this->db->get_where('ndd_user', array('total_mail' => sanitizeMySQL($option['total_mail'])));
if ( $basic_result->num_rows() > 0 )
{
$result = $basic_result->row_array();
return $result;
}
else
{
return '';
}
}
In the model file there is a getByEmail function which outputs the array of query results. However It makes error. How can I do?
Thanks in advance :)