Information submitted!
";
echo "Date: " . date('Y-m-d H:i:s') . "
";
try {
$conn = new PDO("mysql:host=localhost;dbname=testdb", "testuser", "testpass");
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $conn->prepare("INSERT INTO tbl1 (`name`, `from`, `to`) VALUES (:name, :from, :to)");
$stmt->bindParam(':name', $_POST['name']);
$stmt->bindParam(':from', date('Y-m-d H:i:s'));
$toDT='2020-10-10 12:00:00';
$stmt->bindParam(':to', $toDT);
$stmt->execute();
}
catch (PDOException $e) {
echo $e->getMessage();
}
}
?>