Ok the code I am using so far is:
<?php
include 'config.php';
if(isset($_POST['submit']))
{
$refer = addslashes(trim($_POST['refercode']));
$do0 = mysql_query("SELECT referused FROM Users WHERE id = '$refer'") or die(mysql_error());
$do = mysql_query("UPDATE Users SET referused = 1 WHERE id = '$refer' LIMIT 1") or die(mysql_error());
$do2 = mysql_query("UPDATE Users SET kquota = kquota + 50 WHERE id = '$refer' LIMIT 1") or die(mysql_error());
echo '<script>alert("Your friend has been informed that you have signed up with kopoloko! ");</script>';
?><? } mysql_close($l); ?>
I presume the problem I am having is with:
$do0 = mysql_query("SELECT referused FROM Users WHERE id = '$refer'") or die(mysql_error());
Essentially, i want to check weather the referused = 1 and if it does, the script does not continue.
Thanks for your help