I am trying to make a home page that will display part of the last 10 entries into the database as links to those records. Here is my code.
$query = ("SELECT defectid, brief, timestamp FROM defect
ORDER BY timestamp DESC
LIMIT 0, 5");
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
if (mysql_num_rows($result) > 0)
{
while($row = mysql_fetch_object($result))
{
?>
<li><font size="+1"><b><a href="story.php?$defectid=<? echo $row->defectid; ?>">
<?echo $row->$brief;?>
</a></b></font> <br>
<font size="-1">
<? echo formatDate($row->timestamp); ?>
</font>
<p>
<?
}
}
else
{
?>
<font size="-1">No defects currently available</font>
<?
}
?>
For some reason I can't get it to display the link to the full entry, it actually doesn't even display the correct link, it displays $row->brief;?>
Please help, and thank you very much for the assistance.
Lee