[code=php]<?php
require_once(“path”);
require_once(“path”);
require_once(“path”);
$conn = access;
$query = “SELECT `a`.`post_id`, `a`.`author_id`, `a`.`author_name`, DATE_FORMAT(`a`.`date_posted`, ‘%W, %M %d %Y %l:%i %p’), `a`.`category_id`, `c`.`category_name`, `a`.`title`, `a`.`post_body` FROM `posts` `a` INNER JOIN `categories` `c` ON `a`.`category_id` = `c`.`category_id` ORDER BY `a`.`date_posted` DESC LIMIT 4”;
?>
<!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”>
<style type=”text/css”>
#news td
{
padding: 0px 5px 0px 5px;
}
</style>
</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>Hello!</p>
</div>
<div align=”center” id=”center”>
<div id=”welcome”>
<p>Welcome to Ultimate Hogwarts: The Rebirth! Ultimate Hogwarts is an online Hogwarts Role Playing Game where fans
of the Harry Potter books can create their own character, attend Hogwarts, visit the Ministry of Magic, or just
interact with other characters in our story! If you would like to know more about this site, please visit the Rules
page and FAQ page. Once you’re ready to enroll, you can go to the Character Applications forum at our message board
and begin getting your character approved.</p>
</div>
<p><table id=”news”>
<?php
if ($stmt = $conn->prepare($query))
{
if ($stmt->execute()) {
$stmt->bind_result($postID, $authorID, $author, $date, $catID, $category, $title, $body);
while ($stmt->fetch())
{
echo “<p><tr><td><b>” . strip_tags($title, ‘<p><br><a><b><i>’) . “</b></td></tr>”;
echo “<tr><td><b>Posted By: ” . strip_tags($author, ‘<p><br><a><b><i>’) . ” on ” . $date . ” in ” . strip_tags($category, ‘<p><br><a><b><i>’) . “</b></td></tr>”;
echo “<tr><td>” . BBCOdE(truncate(strip_tags($body, ‘<p><br><a><b><i>’))) . “</td></tr></p>”; } $stmt->close(); } else { echo “Statement doesn’t execute”; } } else { echo “Statement isn’t prepared.”; } $conn->close();
/*var_dump($query);*/ ?>
</table></p>
</div>
</div>
</div>
</body>
</html>
First, I’m trying to add some blank lines between my news posts to make it easier to read. So far, I have been unsuccessful.
Next, I’m trying to write it where $title is echoed out as a link to another page. How would I do this?