From 3d4c69801ebdb0b661656d092e6ff7474049ffe5 Mon Sep 17 00:00:00 2001 From: jenkings Date: Fri, 23 May 2025 10:57:29 +0200 Subject: [PATCH] Update Post.php --- models/Post.php | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/models/Post.php b/models/Post.php index 6adb94a..e79f6f2 100755 --- a/models/Post.php +++ b/models/Post.php @@ -122,21 +122,12 @@ class Post { $stmt->bindParam("s", $this->status); $stmt->bindParam("u", $this->updated); $stmt->bindParam("cr", $this->created); - fetch(PDO::FETCH_ASSOC); - return $result['count']; - } -} -?> + + if($stmt->execute()){ + return $this->conn->lastInsertId(); + } + } + } public function update(){ @@ -200,4 +191,4 @@ class Post { return $result['count']; } } -?> \ No newline at end of file +?>