Jump to content

Update a user, do I need to $u->save ?


Doc
 Share

Recommended Posts

Hi,

I'm trying to update some registered members fields such as email, password.

I've made some tests and apparently it works without using $user->save, but I've read that in the forum also (question was how to survive without admin pwd) :

$u = $users->get('admin'); // or whatever your username is
$u->of(false); 
$u->pass = 'your-new-password';
$u->save();

So do I need to $u->save(); after a $u->email = NEW_EMAIL for example ?

Thanks

Link to comment
Share on other sites

You do need to save. Not sure how your tests are set up, but if you set the email and then get it straight after, it will appear changed, but if you reload the page, it won't have stuck unless you save.

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...