From 06d63e029d941a7993abbfb764237a55715c64da Mon Sep 17 00:00:00 2001 From: Mateja Date: Sun, 4 Oct 2020 04:19:03 +0200 Subject: Check and debug your code now... --- test/edit.inc.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test') diff --git a/test/edit.inc.php b/test/edit.inc.php index a08a48a..46d48b4 100644 --- a/test/edit.inc.php +++ b/test/edit.inc.php @@ -4,6 +4,7 @@ if($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['action']) && $_POST["ac try { $conn = new PDO("mysql:host=localhost;dbname=testdb", "testuser", "testpass"); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $stmt = $conn->prepare("UPDATE tbl1 SET `name`=:name, `from`=:from, `to`=:to WHERE id=:id"); $stmt->bindParam(':id', $_POST["id"]); $stmt->bindParam(':name', $_POST["name"]); @@ -23,6 +24,7 @@ if($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['action']) && $_POST["ac try { $conn = new PDO("mysql:host=localhost;dbname=testdb", "testuser", "testpass"); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $stmt = $conn->prepare("SELECT * FROM tbl1 WHERE id=:id"); $stmt->bindParam(':id', $_POST["id"]); $stmt->execute(); -- cgit v1.2.3