php - Uninitialized string offset: 0, why? -
<< error message >> severity: notice message: uninitialized string offset: 0 filename: controllers line number: 192
this error message encountered. , below controller , 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 model file there getbyemail function outputs array of query results. makes error. how can do?
thanks in advance :)
you assigning if($user = '')
at least must be
if($user == '')
Comments
Post a Comment