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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -