title: How do I test if my MySQL update query was successful in CodeIgniter?
body: <p>I have a model function that updates a user in my CodeIgniter application:</p>
  
  <pre><code>// updates first of a user, return true if successful, false if not.
  public function updateFirstName($userId, $newFirstName) {
      $this-&gt;db-&gt;query("UPDATE users SET firstName='$newFirstName' WHERE id=$userId");
      return // whether request was successful?
  }
  </code></pre>
  
  <p>How do I return a boolean value that ensures the user of ID <code>$userId</code> has been updated? For instance, it should return false if no user was found with ID <code>$userId</code>.</p>