<?php
require_once('conecta.php');

$user_id = $_GET["iduser"];

// Delete the user with ID 123
$sql = "DELETE FROM users WHERE id = $user_id";
if (mysqli_query($conn, $sql)) {
    header("location: ../usuarios.php?apagou=ok");
} else {
    echo "Error deleting user: " . mysqli_error($conn);
}

// Close the connection
mysqli_close($conn);
?>