liamloveslearning Posted June 30, 2011 Share Posted June 30, 2011 Hi all . Im trying to have a query run if a post variable is set, I have the following code only its not working can anybody see something im missing? if(isset($_POST['r']) { $refcode = mysql_real_escape_string($_POST['r']); mysql_query(" UPDATE produgg_users SET credits=credits+200000 where produgg_users.id = ".$refcode) or die(mysql_error(); }; Quote Link to comment https://forums.phpfreaks.com/topic/240824-if-statement-stopping-page-from-working/ Share on other sites More sharing options...
Maq Posted June 30, 2011 Share Posted June 30, 2011 Missing a terminating ')'. The error message would help. Quote Link to comment https://forums.phpfreaks.com/topic/240824-if-statement-stopping-page-from-working/#findComment-1236929 Share on other sites More sharing options...
KevinM1 Posted June 30, 2011 Share Posted June 30, 2011 if(isset($_POST['r'])) { $refcode = mysql_real_escape_string($_POST['r']); mysql_query(" UPDATE produgg_users SET credits=credits+200000 where produgg_users.id = ".$refcode) or die(mysql_error()); } Quote Link to comment https://forums.phpfreaks.com/topic/240824-if-statement-stopping-page-from-working/#findComment-1236931 Share on other sites More sharing options...
liamloveslearning Posted June 30, 2011 Author Share Posted June 30, 2011 Brilliant! thanks guys Quote Link to comment https://forums.phpfreaks.com/topic/240824-if-statement-stopping-page-from-working/#findComment-1236934 Share on other sites More sharing options...
Maq Posted June 30, 2011 Share Posted June 30, 2011 Brilliant! thanks guys If you turn on error reporting it will tell you exactly what & where the error is rather than a blank page. Quote Link to comment https://forums.phpfreaks.com/topic/240824-if-statement-stopping-page-from-working/#findComment-1236935 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.