$sql = "SELECT id FROM chatsystem WHERE user1 = ? or user2 = ?";
$stmt = mysqli_stmt_init($connect);
mysqli_stmt_prepare($stmt,$sql);
mysqli_stmt_bind_param($stmt, "ss", $username,$username);
mysqli_stmt_execute($stmt);
$resultData = mysqli_stmt_get_result($stmt);
mysqli_stmt_close($stmt);
if($row = mysqli_fetch_assoc($resultData )){
return $row;
}else{
$result = false;
return $result;
}