I wish to display the last entry on my home page but I cant seem to get this to work, this is the base code can anyone help with what I am missing please, thanks in advance
Steve
<?php
$con = mysql_connect("IP.IP.IP.IP","guestbook","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("web212-guestboo", $con);
$result = mysql_query("SELECT * FROM guestbook WHERE Approved='Approved' order by Date DESC");
while($row = mysql_fetch_array($result))
{
echo $row['Date'];
echo "
";
echo $row['Name'];
echo "
";
echo $row['Comments'];
}
mysql_close($con);
?>