Jump to content

How would I go about writing a referral script?


ffxpwns

Recommended Posts

In the database, I have a table called 'users' inside that I have email, nick (aka username), and balance.  The individual aspects are set up, and work.  My site is also successfully connecting to and reading / writing info in the database.  So my question is:  How would I go about having a box on the register page called 'refer' where the person would enter their referrers email (or nickname, one or the other) then it finds that person, and puts a value of 10 in 'balance'.  Anyone with more experience than me have any ideas?  All help is greatly appreciated.

Maybe...

update tableName set balance = balance + 10 where nick = 'referralName';

 

Sweet!  So I'd replace table name with users, and name the text field referralName?

Well, taking the post data it would look like this:

$sql = "update tableName set balance = balance + 10 where nick = '".$_POST['referralName']."'";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.