skizzy Posted April 3, 2011 Posted April 3, 2011 i tried everything i could think of so can some one please help what im trying to do is update the applicants mail count function app_deny() { global $ir,$c,$h,$userid; $_GET['ID'] = abs((int) $_GET['ID']); mysql_query("DELETE FROM staffapps WHERE appID={$_GET['ID']}",$c); mysql_query("INSERT INTO mail VALUES('', 0, 'System', '{$_GET['user']}', unix_timestamp(),'Your application' ,'Our staff has reviewed your staff application and unfortunately we feel you are not qualified to be a staff member. Feel free to fill in another application.')",$c); $db->query("UPDATE users SET new_mail=new_mail+1 WHERE userid=what goes here"); print "App Denied [url='staff.php?action=appview']> Back[/url]"; } Quote
Curt Posted April 3, 2011 Posted April 3, 2011 This is an easy one :P first off you must define $db as a global variable if your going to use it.. also "what goes here" is $userid which is the persons userid...lol hope that helps Curt Quote
lucky3809 Posted April 3, 2011 Posted April 3, 2011 Curt is correct :-) function app_deny() { global $db,$ir,$c,$h,$userid; $_GET['ID'] = abs((int) $_GET['ID']); mysql_query("DELETE FROM staffapps WHERE appID={$_GET['ID']}",$c); mysql_query("INSERT INTO mail VALUES('', 0, 'System', '{$_GET['user']}', unix_timestamp(),'Your application' ,'Our staff has reviewed your staff application and unfortunately we feel you are not qualified to be a staff member. Feel free to fill in another application.')",$c); $db->query("UPDATE users SET new_mail=new_mail+1 WHERE userid=$userid"); print "App Denied [url='staff.php?action=appview']> Back[/url]"; } Quote
skizzy Posted April 3, 2011 Author Posted April 3, 2011 thank you im still a little new to php alot i still need to learn Quote
Sparky7861 Posted April 4, 2011 Posted April 4, 2011 Umm wouldn't that just update the user that denied the app's mail count? Quote
lucky3809 Posted April 4, 2011 Posted April 4, 2011 well this part ... $db->query("UPDATE users SET new_mail=new_mail+1 WHERE userid=$userid"); should already be in the mailbox.php it's not really needed in the app deny function... It should update the user that is being denied if it's not then $userid should be changed to '{$_GET['user']}' Quote
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.