I did a var_dump on $stmt, and this is what I got:
[code=php]bool(false)
The rest of my code:
[code=php]<?php
require_once(“path_to_connection”);
$conn = connection_settings;
$query = “SELECT `author_id`, `author_name`, DATE_FORMAT(`date_posted`, ‘%W, %M %d %l:%i %p’) `category_id`, `categories.category_name`, `title`, `post_body` FROM `posts` JOIN `categories` ON `posts.category_id` = `categories.category_id` LIMIT 1”;
?>
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<title>Rebirth Test Page</title>
<meta name=”keywords” content=”harry potter,hogwarts,hogwarts rpg,hogwarts online,jk rowling”>
<meta http-equiv=”content-type” content=”text/html; charset=utf-8″>
<meta http-equiv=”cache-control” content=”no-cache”>
<link href=”/css/test.css” rel=”stylesheet” type=”text/css”>
</head>
<body>
<div id=”wrapper”>
<div id=”headers”>
<div id=”header1″></div>
<div id=”header2″>
</div>
</div>
<div id=”navigation”>
<!– Begin Navigation Menu –>
<?php // include the navigation menu
include(“../includes/navigation2.html”); ?>
<!– End Navigation Menu –>
</div>
<div id=”right”>
<p>test text</p>
</div>
<div align=”center” id=”center”>
<div id=”welcome”>
<p>welcome text</p>
<table>
<?php
if ($stmt = $conn->prepare($query))
{
$stmt->bind_result($authorID, $author, $date, $catID, $category, $title, $body);
$stmt->execute();
while ($stmt->fetch())
{
echo “<tr><td><b>” . $title . “</b></td></tr>”;
echo “<tr><td><b>Posted By: ” . $author . “on ” . $date . “in ” . $category . “</b></td></tr>”;
echo “<tr><td>” . $body . “</td></tr>”; } $stmt->close(); } $conn->close();
var_dump($stmt); ?>
</table>
</div>
</div>
</div>
</body>
</html>
For some reason, no data is being output. Does anyone have an explanation?