Hi
Here is some of my website.
The problem is that $story does not loop. It should loop as I declared it above.
<?
require ("xxxxx/functions.php");
$connection = mysql_connect($host, $user, $pass) or die ("Unable to
connect!");
mysql_select_db($db) or die ("Unable to select database!");
//story string
$querystory = "SELECT id, story, timestamp FROM story ORDER BY timestamp DESC";
//story
$result = mysql_query($querystory) or die ("Error in query: $querystory. " .
mysql_error());
if (mysql_num_rows($result) > 0) { while($row =
mysql_fetch_object($result)) {
//display
$story="$row->story";
$timestamp= formatDate($row->timestamp);}}
else{}mysql_close($connection); ?>
<!-- I got the navigation tutorial from alistapart.com just changed a bit --><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><title>site</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="DESCRIPTION" content="xxxx" /><meta name="KEYWORDS" content="William Parry, Music" /><meta name="AUTHOR" content="xxx" /><meta name="RATING" content="General" /><meta name="ROBOTS" content="index, follow" /><meta name="REVISIT-AFTER" content="60 days" />
<style type="text/css">.navul{margin:0;padding:0;list-style:none;width:150px;border-bottom:1px solid #ccc}.navli a{display:block;text-decoration:none;color:#000;background:#fff;padding:5px;border:1px solid #ccc;border-bottom:0;font:normal 11px verdana,arial}* html ul li{float:left;height:1%}* html ul li a{height:1%}.navli a:hover{color:#000;background:#f9f9f9;font:normal 11px verdana,arial}#title{font:bold 15px verdana, serif}#content{font:normal 14px verdana;position:absolute;top:50px;left:180px;}img{border:0}</style></head><body><?
$email="<a href=\"mailto:xxxx\">email</a>";
$title= "<div id=\"title\">xxx<br /><br /></div>";
$navigation="<div><ul class=\"navul\"> <li class=\"navli\"><a href=\"index.php\">xxx</a></li> <li class=\"navli\"><a href=\"index.php?page=about\">About</a></li> <li class=\"navli\"><a href=\"index.php?page=story\">Story</a></li> <li class=\"navli\"><a href=\"index.php?page=websites\">Websites</a></li> <li class=\"navli\"><a href=\"index.php?page=contact\">Contact</a></li></ul></div>";
$page = $_GET['page']; switch ($page) { default: //Index
$thisPage="index"; $thisPagetext="<div id=\"content\"><b>Welcome</b><br /><br />xxx</div>";
break; //Websites
case websites: $thisPage="websites";
$thisPagetext="<div id=\"content\"><b>Websites</b><br /><br />xxx<br /><br /></div>";
break;
//Story
case story: $thisPage="story";
$thisPagetext="<div id=\"content\"><b>A long story</b><br /><br />
$story
</div>";
break;
//About
case about: $thisPage="about";
$thisPagetext="<div id=\"content\"><b>About me</b><br /><br />xxx<br /><br /></div>";
break;
//Contact
case contact: $thisPage="contact";
$thisPagetext="<div id=\"content\"><b>Contact</b><br /><br />xxx</div>";
break;
}
echo"$title";
echo"$navigation";
echo"$thisPagetext";
?></body></html>
The mysql connection works. It displays the latest entry and not the one before. I would like $story to be able to display an entry and then the next entry is shown straight after the one before, so it is continuous.
Thanks!