<?php
include_once '../includes/autoloader.php';
include_once '../includes/function.php';
$obj = new bank;
$db = new dbh;
$dbconn = $db->connect();

$userId = $_POST['userId'];
//  var_dump($userId);
  if ($userId) {
    $sql = "UPDATE `users` SET toggleMessage = 'off' WHERE id = '$userId'";
    $conn = $dbconn->prepare($sql);
    $go = $conn->execute();
    if ($go){
     echo "Message Deactivated";  
 
    }else{
     echo "error";
    }
     
    }