I am creating a dynamic page which changes depending on which ever post the user clicks onto. I am also wanting the views (hit-counter) the page gets to go up by one each time the page is loaded. I am currently getting the following error.
Fatal error: Call to a member function bind_param() on a non-object in C:\Users\PC\Documents\XAMPP\htdocs\post.php on line 13
<?php
session_start();
include 'php/config.php';
$post = $_GET['post'];
$stmt = $mysqli->prepare("SELECT * FROM forum WHERE ForumId = '$post'");
$stmt->execute();
$stmt->bind_result($ForumId,$ForumTitle,$ForumPostText,$PostDate,$Views);
$stmt->fetch();
$stmt->close();
$Views = 1;
$stmt = $mysqli->prepare("UPDATE 'forum' SET 'Views' = 'Views'+ 1 WHERE 'ForumId' = '?' ");
$stmt->bind_param('i',$post);
$stmt->execute();
$stmt->close();
?>
<!DOCTYPE html>
// The rest of the webpage yada yada yada