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:
3
blog.php
3
blog.php
@@ -42,8 +42,9 @@ include_once('header.php') ?>
|
||||
<div class="col-lg-8">
|
||||
<?php
|
||||
// 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->bind_param("s", $status = 'published');
|
||||
$stmt->bind_param("s", $status);
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user