how to create a php input form for sql submit

Question

i am running auto update lastmodified of a post in wordpress, is there a way i can make this my code with html form.
Whereby i will input the date and time and click submit and it will insert into database.

<?php


$servername = "localhost";
$username = "user";
$password = "pass";
$dbname = "db";

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

$sql = "UPDATE zulu_posts SET post_modified_gmt = '2020-11-17-04:00:00'";
$sql = "UPDATE zulu_posts SET post_modified = '2020-11-17-04:00:00'";

if ($conn->query($sql) === TRUE) {
  echo "Record updated successfully";
} else {
  echo "Error updating record: " . $conn->error;
}

$conn->close();
?>
0
KingSolomon 2 months 0 Answers 15 views 0

Leave an answer