<< Error message >>
Severity: Notice
Message: Uninitialized string offset: 0
Filename: controllers
Line Number: 192
这是我遇到的错误消息。以下是控制器和模型文件。
// 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 '';
}
}
在模型文件中有一个 getByEmail 函数,它输出查询结果数组。但是它会出错。我能怎么做?
提前致谢 :)