gideon prewett Posted November 19, 2009 Posted November 19, 2009 i iplimented a new mail system and it fits mostly with my game but the mass mail n gang mails wernt showing up as a new mail so i looked at them and saw i had to add $db->query("UPDATE users SET new_mail=new_mail+1"); but now it says i have 198 mails when i mass mail or gang mail any help would be good Quote
Arek Posted November 19, 2009 Posted November 19, 2009 Hey You need a where clause like "where userid=$userid" Quote
gideon prewett Posted November 19, 2009 Author Posted November 19, 2009 so what would it be for mass mail? Quote
wolfe Posted November 21, 2009 Posted November 21, 2009 You have to put that statement inside the while loop: Heres the example. That way it only credits the gang member one time for each mass mail. $q=$db->query("SELECT * FROM users WHERE gang={$ir['gang']}"); while($r=$db->fetch_row($q)) { //insert into mail statment. $db->query("UPDATE users SET new_mail=new_mail+1 WHERE userid={$r['userid']}"); print "Mass mail sent to {$r['username']}. "; } 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.