First of all, this line:
$update = mysql_query("UPDATE `hard_users` SET `refers` = '".$the_added."' WHERE `uid` =12 LIMIT 1 );
is missing an ending double quote, should be:
$update = mysql_query("UPDATE `hard_users` SET `refers` = '".$the_added."' WHERE `uid` =12 LIMIT 1");
Second of all, the error on the link you provided says that you specified a column that doesnt exist in the MySQL table (id_link), though I don't see that in your code. Try fixing the above error and let us know.