title: Codeigniter $this->db->get_where
body: <p>not work submit the form, I have an error.
  A PHP Error was encountered</p>
  
  <blockquote>
    <p>Severity: Notice</p>
    
    <p>Message: Trying to get property of non-object</p>
    
    <p>Filename: controllers/Admin.php Line Number: 253 Backtrace: File:
    C:\OpenServer\domains\medicalsystem.com\application\controllers\Admin.php
    Line: 253 Function: _error_handler
    Blockquote</p>
  </blockquote>
  
  <pre><code>if ($task == "create"){
  
      $email = $_POST['email'];       
      $patient = $this-&gt;db-&gt;get_where('patient', array('email' =&gt; $email))-&gt;row()-&gt;name;      
      if ($patient == null) {
          $this-&gt;crud_model-&gt;save_patient_info();
          $this-&gt;session-&gt;set_flashdata('message', get_phrase('patient_info_saved_successfuly'));
      } else {
          $this-&gt;session-&gt;set_flashdata('message', get_phrase('duplicate_email'));
      }
      redirect(base_url() . 'index.php?admin/patient');
  }
  </code></pre>
  
  <p><strong>Error line code</strong></p>
  
  <pre><code>$patient = $this-&gt;db-&gt;get_where('patient', array('email' =&gt; $email))-&gt;row()-&gt;name;
  </code></pre>
  
  <p>this line has a problem.</p>