<< Error message >>
Severity: Notice
Message: Uninitialized string offset: 0
Filename: controllers
Line Number: 192
이 오류 메시지가 나타납니다. 아래에는 컨트롤러 및 모델 파일이 있습니다.초기화되지 않은 문자열 오프셋 : 0, 이유는 무엇입니까?
// 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 함수가 있습니다. 그러나 오류가 발생합니다. 어떻게해야합니까? 사전 :
'line 192'의 위치를 알려주시겠습니까? – guessimtoolate
각주 "// 192"를 추가했습니다. – nextdoordoc
제 내기는'if ($ user = '')'- 빈 문자열 값을'$ user'에 할당하기 때문에 당신이 else에 있는지 검사 할 때입니다. 아마도'if ($ user == '')'를 의미했을 것입니다. – guessimtoolate