Ok, working on a blog engine. Small and somewhat unimpressive, basically following along with a tutorial. The tutorial basically has me write a little MySQL to query some test fields that we filled in manually. And here is what I get.
(see attachments)
The first one shows the read out from by web browser, and yes, I am positive Xampp is running. The second is what phpMyAdmin is telling me about fetching zero rows. Here is the code I have been using.
<?php
require("header.php");
$sql = "SELECT entries.*, catagories.cat FROM entries, catagories
WHERE entries.cat_id = catagories.id
ORDER BY dateposted DESC
LIMIT 1;";
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
echo "<h2><a href='viewentry.php?id=" . $row['id'] . "'>" . $row['subject'] . "</a></h2><br />";
echo "<em> In <a href='viewcat.php?id=" . $row['cat_id'] . "'>" . $row['cat'] . "</a> - Posted on " . date("D jS F Y g.iA", strtotime($row['dateposted'])) . "</em>";
echo "<p>";
echo nl2br($row['body']);
echo "</p>";
echo "<p>";
$commsql = "SELECT name FROM comments WHERE blog_id = " . $row['id'] . "ORDER BY dateposted;";
$commresult = mysql_query($commsql);
$numrows_comm = mysql_num_rows($commresult);
require("footer.php");
?>
The required heading is here:
<?php
require("config.php");
$db = mysql_connect($dbhost, $dbuser, $dbpassword);
mysql_select_db($dbdatabase, $db);
?>
<!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" xml:lang="en" lang="en">
<head>
<title><?php echo $config_blogname; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="styles/blog.css"/>
</head>
<body>
<div id="header">
<h1><?php echo $config_blogname; ?></h1>
[<a href="index.php">Home</a>]
</div>
<div id="main">
</div>
and the config file looks like this:
<?php
$dbhost = "localhost";
$dbuser = "root";
$dbpassword = "";
$dbdatabase = "dante2";
$config_blogname = "Funny old world";
$config_author = "Jono Bacon";
$config_basedir = "http://127.0.0.1/Dynamic Web Applications/blogtastic";
?>
Thanks in advance for tip pointers and especial corrections. =D