Hi, i am just adding the last component to my registration page, but i am having a little trouble with it. Basically my website includes a referal based system, wherebye when the user signs up they can add a referal that benefits the referal later on. The code i am trying to add is to increase the number of referals a member has by 1. It might sound a bit confusing and trust me its taken a few hours to get my head around it, but my code must find the information of the referal and update their number of referals by 1. The code i have below is what i think should work, but it does not update the number of referals by 1.
if($referal_check > 0)
{
mysql_query("UPDATE referrals SET no_of_referrals = no_of_referrals + '1' WHERE username = '$referal'");
}
The referal_check is a query to find whether the referal exists in the system, the code is below
$sql_referal_check = mysql_query("SELECT username FROM user_info WHERE username='$referal'");
$referal_check = mysql_num_rows($sql_referal_check);
Sorry if this is a bit confusing, please ask if you need some more clarification on the code.
Thanks