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

XF 1.4 SQL Query like_count

Discussion in 'XenForo Questions and Support' started by Joe., Mar 27, 2015.

  1. Joe.

    Joe. Active Member

    So in xf_user it shows the like_count for each user.

    Does anyone know of an SQL query I can run to change a specific user's like_count to a different number?
  2. Brogan

    Brogan XenForo Moderator Staff Member

    You can do it in the ACP on the member profile page via the [Profile Info] tab.
  3. Joe.

    Joe. Active Member

    Would it be faster to run SQL queries though?

    I am going to be doing this for a lot of users.
  4. Joe.

    Joe. Active Member

    Okay I think I got one figured out:

    UPDATE  `xf_user` SET  `like_count` =  '659' WHERE  `user_id` =34
    (an example of updating member #34 to have 659 likes)

    .... Did I do that right?
  5. Solidus

    Solidus Well-Known Member

    UPDATE `xf_user` SET `like_count` = '659' WHERE `xf_user`.`user_id` = 34;
    Joe. likes this.
  6. Joe.

    Joe. Active Member

    Thanks @Solidus

    Seems both do the job just fine. You could also throw your database name in there before the first `xf_user` (after the word "Update")

Share This Page