Are there alternative methods in PHP to prevent users from using multiple accounts?

One way to prevent users from using multiple accounts in PHP is to implement a system that restricts users from registering or logging in with multiple accounts using the same email address or username. This can be achieved by checking the database for existing accounts with the same email or username before allowing a new registration or login.

// Check if the email address is already registered
$email = $_POST['email'];
$query = "SELECT * FROM users WHERE email = '$email'";
$result = mysqli_query($conn, $query);

if(mysqli_num_rows($result) > 0) {
    // Email address is already registered, display an error message
    echo "This email address is already registered. Please use a different email address.";
} else {
    // Proceed with registration or login
}