Need one result in this script only loop once help please

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); ?>

You just need to change your sql query. Here is how:
[php]$result = mysql_query(“SELECT * FROM guestbook WHERE Approved=‘Approved’ order by Date DESC limit 1”);[/php]

OMG so simple, yet it had me trying to run while for loops and failing thank you so much.

Kind Regards
Steve

Sponsor our Newsletter | Privacy Policy | Terms of Service