<?php
    //setting header to json
    header('Content-Type: application/json');
    header("Access-Control-Allow-Origin: *");

    $id = $_GET["i"];  // get logID
    
    require '../php/database.php';

    $query = "DELETE FROM log WHERE logID = '$id'";

    //execute query
    $result = $mysqli->query($query);

    //loop through the returned data
    $dataWindow = "1";
    // foreach ($result as $row) {
    //     $dataWindow[] = $row;
    // }

    //free memory associated with result
    // $result->close();

    //close connection
    $mysqli->close();
    // print_r(json_encode($dataWindow));
    //now print the data
    print json_encode($dataWindow);