QUOTE
<html>
<head>
<?php
mysql_connect("localhost", "myhost", "mypassword");
mysql_select_db("jrcooper_zzl_poems");// connect to database
$sql="SELECT * FROM poetry";
$res=mysql_query($sql);
while ($entry = mysql_fetch_object ($res)) {
if ($cat==$entry->category) {
// increment amnt
$amnt=$amnt+1;
//store in arrays
$title[$amnt]=$entry->title;
$dat[$amnt]=$entry->date;
$category[$amnt]=$entry->category;
$poem[$amnt]=$entry->poem;
$dedication[$amnt]=$entry->dedication;
$rate[$amnt]=$entry->rate;
}
}
mysql_free_result ($res);
?>
</head>
<body>
<?php
// display poems
for ( $i = 1; $i <= $amnt; $i += 1) {
echo '<h3><a name="'.$i.'">'.$title[$i].'</a></h3>';
print "<h2>";
Long_date($dat[$i]);
print "</h2>";
print "<p>$poem[$i]</p>";
}
}
?>
</body>
</html>
<head>
<?php
mysql_connect("localhost", "myhost", "mypassword");
mysql_select_db("jrcooper_zzl_poems");// connect to database
$sql="SELECT * FROM poetry";
$res=mysql_query($sql);
while ($entry = mysql_fetch_object ($res)) {
if ($cat==$entry->category) {
// increment amnt
$amnt=$amnt+1;
//store in arrays
$title[$amnt]=$entry->title;
$dat[$amnt]=$entry->date;
$category[$amnt]=$entry->category;
$poem[$amnt]=$entry->poem;
$dedication[$amnt]=$entry->dedication;
$rate[$amnt]=$entry->rate;
}
}
mysql_free_result ($res);
?>
</head>
<body>
<?php
// display poems
for ( $i = 1; $i <= $amnt; $i += 1) {
echo '<h3><a name="'.$i.'">'.$title[$i].'</a></h3>';
print "<h2>";
Long_date($dat[$i]);
print "</h2>";
print "<p>$poem[$i]</p>";
}
}
?>
</body>
</html>