Welcome Guest, Not a member yet? Register   Sign In
Result check for $this->db->query();
#1

[eluser]veledrom[/eluser]
Hi,

I am calling function below to update password but how to a make sure that it has been successfully updated or failed?

Thanks

Code:
public function update_myself($user_id, $text_new_password)
{
   $sql = "UPDATE login SET password = SHA1(?) WHERE id = ?";
   $this->db->query($sql, array($text_new_password, $user_id));
  
   if(... blah blah ...)
   {
     return 'Success';
   }
   else
   {
     return 'Fail';
   }
}




Theme © iAndrew 2016 - Forum software by © MyBB