Hi I am not too sure what is wrong with what I have written. A friend has simular code but mine wont work. Would appreciate help.
if (isset($_GET['postID']))
{
$postID = $_GET['postID'];
$stmt = $mysqli->prepare("SELECT postTitle FROM Posts WHERE postID = ?");
$stmt->bind_param('i', $postID);
$stmt->execute();
$stmt->bind_result($postTitle);
echo $postTitle;
}
Thanks
You have not fetched results with
$stmt->fetch(). Although you have bound your result column to$postTitle, no value will be available unless you fetch a row from the statement result set.