There are two types of user in my site-1. normal user 2. premium user
Only premium user can invite people through email. Email contains url with ref parameter that is userid.
When user creates an account with this link, ref id inserts into database. Now i want to add predefined commission to the user who got referral user. Actually, i want to pay User A for getting referrals up to level 7 and condition is that commission will be paid to user A when his referral switch to premium account.
Current table structure is:userid,name, email, pass, ref_by, premium(booleon).
How to add money column and what will be the logic or code?