<?php
// Assuming you have already established a connection to the database
include("./include/config.php");

// Truncate the "sms" table
$sql = "TRUNCATE TABLE data";

if (mysqli_query($conn, $sql)) {
    // Truncation successful, redirect to another page
    header("Location: data_view.php");
    exit(); // Make sure to exit after redirecting
} else {
    echo "Error truncating table: " . mysqli_error($conn);
}

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