Announcement

Collapse
No announcement yet.

Referrals

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Referrals

    What type of mysql query would I create to get the referrals of a user?

  • #2
    *** We always recommend a database backup before manually running any queries ***

    Something like this-

    Code:
    SELECT * FROM user AS user
    WHERE referrerid = 999
    Replace 999 with the userid of the user whose referrals you want to check,

    Or to view ALL users who put in a referral and who it was-

    Code:
    SELECT user.username, user2.username AS referredby FROM user AS user
    LEFT JOIN user AS user2 ON user2.userid = user.referrerid
    WHERE user.referrerid > 0
    If you use table prefixes be sure to put the prefix before any of the user in red in the queries. (so user may become vb_user if vb_ is the prefix)

    Comment

    Related Topics

    Collapse

    • sudbury8
      Cant login
      by sudbury8
      Can some tell how to find the file to do this.Thanks
      UPDATE user AS user
      SET token = concat(MD5(concat(MD5('pass1234'), user.token)),' ', user.token), scheme = 'legacy'
      WHERE userid...
      Tue 19 Aug '14, 7:23am
    • yi.zhou@xplusz.com
      How to optimize user table
      by [email protected]
      Hi, my forum is reaching almost 5m register user which make the user table about 7.5GB. It also cause timeout when search user in admincp, usergroup management page, moderator permission, and it all seems...
      Tue 10 Apr '18, 5:34pm
    Working...
    X