blog post
the fields are
id
author
title
content
date_posted
I use a simple method of retrieval from the database in blogread.php but I have a problem as it won't query $bloginfo2
blogread.php
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<link rel="stylesheet" href="style.css" type="text/css" />
<?php
include_once('connect.php');
$bloginfo="SELECT * FROM blog post ORDER BY date_posted";
$bloginfo2=mysql_query($bloginfo) or die("Could not query blog info");
$bloginfo3=mysql_fetch_array($bloginfo2);
$blogdate=mysql_num_rows($bloginfo2);
?>
<div id="bloghead" align="center">
<?php
echo "<b>'bloginfo3[title]'</b><br/>";
echo "<i>'$bloginfo3[author]'</i><br/>";
echo "'$blogdate[date_posted]'<br/>";
?>
</div>
<div id="blogcontent" align="center">
<?php
echo "'$bloginfo3[content]'";
?>
<body>
</body>
</html>