title: Codeigniter database update issues
body: <p>I am having issues in updating a table in my database (MySQL workbench).</p>
  
  <p>The code in my model is the following:</p>
  
  <pre><code>function updateMail($new) {
      $data = array(
          'email' =&gt; $new
      );
      $this-&gt;db-&gt;where('email', $this-&gt;session-&gt;userdata('email'));
      $result = $this-&gt;db-&gt;update('person', $data);
      $error = $this-&gt;db-&gt;error();
      return $error;
  }
  </code></pre>
  
  <p>My controller then places the return value in $result, and chechs <code>if(!isset($result))</code>.</p>
  
  <blockquote>
    <p>the problem is that sometimes the table updates, sometimes it doesn't,
    but the error is always set.</p>
  </blockquote>
  
  <p>The table basically contains persons with an id, name, firstname, password, username, email, and patient field.</p>
  
  <p>Am I doing something wrong? Or is there a way a can display the error message it throws?</p>