<?php


// List of tables to clear
$tables = ["work_order_name", "work_order_detail", "work_order_customer_ref_mapping", "work_order_assign", "work_order", "manufacture_machine_table", "cnc_machine_table", "pu_machine_table", "vac_machine_table", "assbly_machine_table", "purchase_list", "manufacture_machine_children", "purchase_order","part_count_log","machine_breakdown", "machine_activity_log"];

foreach ($tables as $table) {
    // Use DELETE if you want to preserve AUTO_INCREMENT counters
    $sql = "DELETE FROM $table";
    //$sql = "TRUNCATE TABLE $table"; // use this if you want to reset AUTO_INCREMENT
    
    if ($conn->query($sql) === TRUE) {
        echo "All records deleted from $table<br>";
    } else {
        echo "Error deleting records from $table: " . $conn->error . "<br>";
    }
}


?>
