Phpfr3ak Posted August 13, 2011 Share Posted August 13, 2011 $sql = "UPDATE players SET is_banned = 1 WHERE id = $id"; mysql_query($sql); Sorry really not all that great i want to also ban MASTERPLAYERID i assumed it would be; $sql = "UPDATE players SET is_banned = 1 WHERE id = $id AND WHERE MASTERPLAYERID = $MASTERPLAYERID"; mysql_query($sql); But its not could someone inform me how to pull this off, Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/244709-dont-quiet-understand/ Share on other sites More sharing options...
jcbones Posted August 13, 2011 Share Posted August 13, 2011 Really vague there. We don't know what MASTERPLAYERID is, where it is stored, or how it is populated. If you ban a player in the players table, and the database is normalized, then you should have no problem enforcing the ban anywhere in the script. Quote Link to comment https://forums.phpfreaks.com/topic/244709-dont-quiet-understand/#findComment-1256916 Share on other sites More sharing options...
AyKay47 Posted August 13, 2011 Share Posted August 13, 2011 place this in your script to debug the query.. $sql = "UPDATE players SET is_banned = 1 WHERE id = $id AND WHERE MASTERPLAYERID = $MASTERPLAYERID"; mysql_query($sql) or die(mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/244709-dont-quiet-understand/#findComment-1256923 Share on other sites More sharing options...
jcbones Posted August 13, 2011 Share Posted August 13, 2011 2 where's in a query will fail. Quote Link to comment https://forums.phpfreaks.com/topic/244709-dont-quiet-understand/#findComment-1256933 Share on other sites More sharing options...
Phpfr3ak Posted August 14, 2011 Author Share Posted August 14, 2011 sorry for being so vague MASTERPLAYERID is in the player table, its basically used to control more than one account without having to use a password that works fine, the ban works as is just using; $sql = "UPDATE players SET is_banned = 1 WHERE id = $id"; mysql_query($sql) or die(mysql_error()); But id also like it to ban everyone with thesame MASTERPLAYERID as well as the id that im banning. hope this makes more sense? Quote Link to comment https://forums.phpfreaks.com/topic/244709-dont-quiet-understand/#findComment-1256950 Share on other sites More sharing options...
AyKay47 Posted August 14, 2011 Share Posted August 14, 2011 jcbones is right, I missed that, your syntax is wrong.. change to this.. $sql = "UPDATE players SET is_banned = 1 WHERE id = $id AND MASTERPLAYERID = $MASTERPLAYERID"; note case-sensitivity.. Quote Link to comment https://forums.phpfreaks.com/topic/244709-dont-quiet-understand/#findComment-1256952 Share on other sites More sharing options...
jcbones Posted August 14, 2011 Share Posted August 14, 2011 I would remove the id=$id part, and just ban on the masterplayerid, that way, every account would be banned, and not just one row. Quote Link to comment https://forums.phpfreaks.com/topic/244709-dont-quiet-understand/#findComment-1256955 Share on other sites More sharing options...
Phpfr3ak Posted August 14, 2011 Author Share Posted August 14, 2011 Thanks guys, done jcbones worked great thanks alot! Quote Link to comment https://forums.phpfreaks.com/topic/244709-dont-quiet-understand/#findComment-1256958 Share on other sites More sharing options...
AyKay47 Posted August 15, 2011 Share Posted August 15, 2011 Didn't fully understand the question. Glad you figured it out Quote Link to comment https://forums.phpfreaks.com/topic/244709-dont-quiet-understand/#findComment-1257510 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.