javascript – Execute PHP function from within HTML script

I’m trying to execute a specific PHP command every time my index.html file is run. Specifically, I want to execute the following SQL command from getdata.php which deletes a row from my SQL data table:

$sql = "DELETE FROM studycondition ORDER BY id ASC LIMIT 1";

Thus, the idea is that every time index.html is run then a row from the SQL table is deleted. Any ideas as to how I can execute the delete SQL function from my HTML file?
See below for the full code.



$data_array = json_decode(file_get_contents('php://input'), true);

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);

$sql = "SELECT cond FROM studycondition";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
  // output data of each row
  if($row = $result->fetch_assoc()) {
    //echo json_encode("id: " . $row("cond"). "<br>");
    echo json_encode($row("cond"));
} else {
  echo "0 results";

$sql = "DELETE FROM studycondition ORDER BY id ASC LIMIT 1"; //this is what I want to transfer to my HTML file 




    function reqListener () {

    var oReq = new XMLHttpRequest(); // New request object
    oReq.onload = function() {
        const js = document.createElement("script");
        var noQuotes = this.responseText.split('"').join('');
        js.src = noQuotes;

    };"get", "index.php", true);

//line to execute delete SQL data command ???