Or
connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT * FROM users WHERE username = ?"; $stmt = $conn->prepare($sql); $stmt->bind_param("s", $username); // Execute the statement $stmt->execute(); // Get the result $result = $stmt->get_result(); // Check if the user exists and verify the password if ($result->num_rows > 0) { $row = $result->fetch_assoc(); if (password_verify($password, $row['password'])) { $_SESSION["username"]=$username; $_SESSION["login"]=true; $_SESSION["perms"]=$row["perms"]; $_SESSION["email"]=$row["email"]; $_SESSION["telegram_id"]=$row["telegram_id"]; echo ''; exit(); } else { echo '