Okay, just figured out a second problem.
That above query would not work correctly.
Here's actually what should happen. If BOB signs up, the system first adds his info to the database and knows who referred him by adding their id number to the field "refferer". Then after they pay, it activates their account by setting the "active" field to 1.
Now, after paying through paypal, the current sql query just activates them. But I want to increase the "ref_num" field by 1 for the person that referred them. So the query should look like this:
PHP Code:
$query2 = "update resellers set active='1' where id='$item_number' set ref_num=ref_num+1" where id='xy(refferer field in same row as BOB)';
So, what's the correct syntax for this??? updating the active field for the current row (where id=$item_number), then updating the ref_num field by 1 for the person that referred them. We know who referred them because the refferer field tells us the id number of the person that referred them.