<?php
include("./include/config.php");
$id = $_GET['id'];

// Prepare and execute the SQL query to delete the row
$sql = "DELETE FROM sms WHERE id = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("i", $id);
$stmt->execute();

if ($stmt->affected_rows > 0) {
    // Redirect to another page after successful deletion
    header("Location: dashboard.php");
    exit;
} else {
    echo "No row deleted.";
}
?>