I guess i need to be more clear sorry about that.
It would increment by a set value like 0.10 each time the member gets a referral...
My other problem is this..
If this is his first refferral then it needs to insert affiliate id plus 0.00
then add 0.10 to that
I dont want it to keep adding a row each time he gets a refferal
WIthout having a referral there is no row for that member.
$query = "select * from referralamount where user_id='$affid'";
if($affid=='') {
query = "INSERT INTO referralamount (`user_id`, `amount`)values('$affid','0.00')";
}else{
query = "update referralamount set amount=amount+'0.10' where user_id='$affid'";
};
The above code doesnt work right, if the member has a row with his info in it, that members amount still increases and he gets another row, which is what i dont want...
What am i doing wrong..
Here is the table
CREATE TABLE referralamount (
id int(11) NOT NULL auto_increment,
user_id varchar(255) NOT NULL default '',
amount float(14,2) NOT NULL default '0.00',
PRIMARY KEY (id)
) TYPE=MyISAM;
I need it to check to see if it has a row, and if it does add the increment and if it doesnt then add a row and update it same time
Geeze i hope this makes sence to someone..