From a645e7efcbae7ca33eef39f5b2c2e2b841f4f69d Mon Sep 17 00:00:00 2001 From: sundowndev Date: Sun, 22 Jul 2018 02:31:58 +0200 Subject: [PATCH] Task repository --- server/src/Repository/TaskRepository.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/src/Repository/TaskRepository.php b/server/src/Repository/TaskRepository.php index 77077e6..392d39c 100644 --- a/server/src/Repository/TaskRepository.php +++ b/server/src/Repository/TaskRepository.php @@ -1,7 +1,6 @@ db->getConnection()->prepare('INSERT INTO ' . $this->tableName . ' (user_id, title, description, creation_date, status) VALUES(:user_id, :title, :description, :creation_date, :status)'); + $stmt = $this->db->getConnection()->prepare('INSERT INTO ' . $this->tableName . ' (user_id, title, description, creation_date, status) VALUES(:user_id, :title, :description, NOW(), :status)'); $stmt->bindParam(':user_id', $data['user_id'], \PDO::PARAM_INT); $stmt->bindParam(':title', $data['title'], \PDO::PARAM_STR); $stmt->bindParam(':description', $data['description'], \PDO::PARAM_STR); - $stmt->bindParam(':creation_date', $data['creation_date']); $stmt->bindParam(':status', $data['status'], \PDO::PARAM_INT); $stmt->execute();