<?php
include 'dbconnection.php';

$ComID = $_GET['ID'];
$Email = $_GET["Email"]; 

$DB = mysqli_query($mysql,"SELECT dbname FROM tb_users WHERE email ='$Email'");
while($row = mysqli_fetch_array($DB)){
$dbname = $row ['dbname'];

}


$hostname2 = "localhost";
$username2 = "tempdpe5_nicolas";
$password2= "(Made7575)";
$conn = mysqli_connect($hostname2,$username2,$password2,$dbname);
if (mysqli_connect_errno()){
  printf("Connect failed: %s\n", mysqli_connect_error());
  exit();
} 
mysqli_set_charset($conn ,"utf8");




mysqli_query($conn,"UPDATE comunicacion SET Status ='Chatlock' WHERE ComID ='$ComID'");

mysqli_close($conn);
mysqli_close($mysql);

echo "<script>window.location.href = 'comunicacion';</script>"
?>