From 1d7a50709ebbeb6cfd598c9be91da310ff9f9786 Mon Sep 17 00:00:00 2001 From: twotalesanimation <80506065+twotalesanimation@users.noreply.github.com> Date: Thu, 4 Dec 2025 09:37:48 +0200 Subject: [PATCH] Fix: blog.php bind_param() reference error - Moved variable assignment outside of bind_param() - Line 46: Changed bind_param("s", $status = 'published') to separate assignment - Fixes: "mysqli_stmt::bind_param(): Argument #2 cannot be passed by reference" - bind_param() requires variables by reference, not inline assignments --- blog.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/blog.php b/blog.php index 53e1c094..ef5bfe76 100644 --- a/blog.php +++ b/blog.php @@ -42,8 +42,9 @@ include_once('header.php') ?>
prepare("SELECT blog_id, title, date, category, image, description, author, members_only, link FROM blogs WHERE status = ? ORDER BY date DESC"); - $stmt->bind_param("s", $status = 'published'); + $stmt->bind_param("s", $status); $stmt->execute(); $result = $stmt->get_result();