I want to fetch data with the prepared statements but getting the following answer. I also tried to follow previous solved question related to this which was given on StackOverflow but failed. Help me to solve the issue.
Fatal error: Uncaught Error: Call to a member function execute() on bool
<?php
$stmt = $mysqli->prepare("SELECT id,addpage,post_name FROM detail WHERE id = ? ");
$stmt->execute();
$result = $stmt->get_result();
var_dump($row = $result->fetch_all(MYSQLI_ASSOC));
echo $row['id'];
echo $row['addpage'];
echo $row['post_name'];
?>