UPDATE user SET options = options + 16 WHERE (NOT (options & 16)) AND userid = ID
to set it to Yes, and
Code:
UPDATE user SET options = options - 16 WHERE options & 16 AND userid=ID
to set it to No. Note that you must change ID to the actual userid in each case. I'm assuming you can write php to do those queries.
As Lynne says, this can be done from the admincp without writing php, but since you said in the first post that you want moderators to be able to do it without giving them permission to change any other settings, I'm guessing that you've decided to write your own code to allow them to do it.
thnx brother , yeah that's what i want to do
now everything is good
Thank you for your understanding of my request kh99
PHP Code:
if ($_REQUEST['do'] == 'editemailadmin') {
$user = $db->query_first(" SELECT options FROM " . TABLE_PREFIX . "user WHERE userid = '" . $_REQUEST['userid'] ."' ");