questo codice php mi da il seguente errore: "POST /OneDrive/Desktop/newsCOPY/signup-codice.php - Uncaught Error: Call to a member function prepare() on null in C:\Users\diego\OneDrive\Desktop\newsCOPY\signup-codice.php:25
Stack trace:
#0 {main}
  thrown in C:\Users\diego\OneDrive\Desktop\newsCOPY\signup-codice.php on line 25"

il codice è il seguente:

<?php
session_start();
include 'connection.php';
$conn = OpenCon();

if ($_SESSION['descrizione'] == 'gestore') {

    function validate($data)
    {
        $data = trim($data);
        $data = stripslashes($data);
        $data = htmlspecialchars($data);
        return $data;
    }

    $uname = validate($_POST['username']);
    $pass = validate($_POST['password']);
    $confirmPass = validate($_POST['confirm_password']);

    $hash_pass = password_hash($pass, PASSWORD_DEFAULT);

    if ($pass == $confirmPass) {
       // $sql = "INSERT INTO account (username, password) VALUES ('$uname', '$hash_pass')";

        $stmt = $mysqli->prepare("INSERT INTO account (username, password) VALUES (?, ?)");
        $stmt->bind_param("ss", $uname, $hash_pass);
        $result = $stmt->execute();
        
        if ($result) {
            $sql = "SELECT idAccount FROM account ORDER BY idAccount DESC LIMIT 1";
            $result = mysqli_query($conn, $sql);
            $row = mysqli_fetch_array($result, MYSQLI_ASSOC);
            $idAcc = $row['idAccount'];

            $name = mysqli_real_escape_string($conn, $_POST['name']);
            $surname = mysqli_real_escape_string