whelpton Posted July 23, 2008 Share Posted July 23, 2008 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 Link to comment https://forums.phpfreaks.com/topic/116304-solved-please-help-mysql-amp-php/ Share on other sites More sharing options...
MasterACE14 Posted July 23, 2008 Share Posted July 23, 2008 <?php $do0 = mysql_query("SELECT referused FROM Users WHERE id = '$refer'") or die(mysql_error()); $row = mysql_fetch_array($do0); if($row['referused'] == 1) { die("message"); } Regards ACE Link to comment https://forums.phpfreaks.com/topic/116304-solved-please-help-mysql-amp-php/#findComment-598058 Share on other sites More sharing options...
whelpton Posted July 23, 2008 Author Share Posted July 23, 2008 Thank you so much, means alot! Link to comment https://forums.phpfreaks.com/topic/116304-solved-please-help-mysql-amp-php/#findComment-598061 Share on other sites More sharing options...
MasterACE14 Posted July 23, 2008 Share Posted July 23, 2008 no problem Link to comment https://forums.phpfreaks.com/topic/116304-solved-please-help-mysql-amp-php/#findComment-598063 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.