"UPDATE referrals SET no_of_referrals = no_of_referrals +1 WHERE username = '$referal'"
no need for quotes around 1.
echo out the sql to see if its what you expect
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
if($referal_check > 0)
{
echo "UPDATE referrals SET no_of_referrals = no_of_referrals + 1 WHERE username = '$referal'";
mysql_query("UPDATE referrals SET no_of_referrals = no_of_referrals + 1 WHERE username = '$referal'");
}
echo "SELECT username FROM user_info WHERE username='$referal'";
$sql_referal_check = mysql_query("SELECT username FROM user_info WHERE username='$referal'");
$referal_check = mysql_num_rows($sql_referal_check);
I didn't understand any of the include stuff you stated as it's not included in the code you supplied, so the above is what I suggest.
If you don't get any output from the UPDATE echo, it's because the $referal_check is not > 0.
If you do get output - copy the output to the screen and paste it into phpmysql and see if it works.
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
once again it seems to be the
if($referal_check > 0)
Try taking it off to see what happens.
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080