🐛 Fix bindParam() issue

Signed-off-by: Luke Tainton <luke@tainton.uk>
This commit is contained in:
2020-08-10 15:03:35 +01:00
parent 37355bf007
commit d7f9678fd6

View File

@@ -7,12 +7,11 @@
try { try {
// Process ticket data // Process ticket data
$tkt_uuid = Uuid::uuid4()->toString(); $tkt_uuid = Uuid::uuid4()->toString();
$stmt = "INSERT INTO tickets (uuid, title, description, status, created_by) VALUES (:tktuuid, :title, :description, :status, :user)"; $stmt = "INSERT INTO tickets (uuid, title, description, status, created_by) VALUES (:tktuuid, :title, :description, 'New', :user)";
$sql = $db->prepare($stmt); $sql = $db->prepare($stmt);
$sql->bindParam(':tktuuid', $tkt_uuid); $sql->bindParam(':tktuuid', $tkt_uuid);
$sql->bindParam(':title', $_POST['title']); $sql->bindParam(':title', $_POST['title']);
$sql->bindParam(':description', $_POST['description']); $sql->bindParam(':description', $_POST['description']);
$sql->bindParam(':status', 'New');
$sql->bindParam(':user', $_SESSION['uuid']); $sql->bindParam(':user', $_SESSION['uuid']);
$sql->execute(); $sql->execute();
} catch (PDOException $e) { } catch (PDOException $e) {