1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Update Custom Field

Discussion in 'XenForo Development Discussions' started by nrep, Mar 2, 2015.

  1. nrep

    nrep Well-Known Member

    I'm creating an add-on where I need to update a custom field within my controller - is there a way to do with without manually running a MySQL query, as this wouldn't update the user cache at the same time?

    Any guidance would be most appreciated :).
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    The way to do it is already all there in the code. Think about someone being on the Account / Personal Details page and saving a value there. You will want to basically do exactly the same thing (albeit on a subset of fields, rather than an entire group of them).
     
    nrep likes this.
  3. nrep

    nrep Well-Known Member

  4. Chris D

    Chris D XenForo Developer Staff Member

    Looks good to me. That's pretty much what the code I was mentioning does :)
     
  5. nrep

    nrep Well-Known Member

    Thanks, I've just added it and it works :D.
     

Share This Page