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(); } } ?> Test table



\n"; echo "IDFromToNameActions\n"; foreach ($conn->query("SELECT * FROM tbl1") as $row) { echo "" . $row['id'] . ""; echo "" . $row['from'] . ""; echo "" . $row['to'] . ""; echo "" . $row['name'] . ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; } echo "\n"; } catch (PDOException $e) { echo $e->getMessage(); } ?>