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
This commit is contained in:
twotalesanimation
2025-12-04 09:37:48 +02:00
parent 7e544311e3
commit 1d7a50709e

View File

@@ -42,8 +42,9 @@ include_once('header.php') ?>
<div class="col-lg-8"> <div class="col-lg-8">
<?php <?php
// Query to retrieve data from blogs table // Query to retrieve data from blogs table
$status = 'published';
$stmt = $conn->prepare("SELECT blog_id, title, date, category, image, description, author, members_only, link FROM blogs WHERE status = ? ORDER BY date DESC"); $stmt = $conn->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(); $stmt->execute();
$result = $stmt->get_result(); $result = $stmt->get_result();