I get a parse error at the end of my code. I can create an entry and successfully add it. Everytime I try to view it this message appears Parse error: parse error in C:\wamp\www\viewguestbook.php on line 57. Please HELP!!! so close to being finished

<?php
$host="localhost"; // Host name 
$username="root"; // Mysql username
$password="sanfan49er"; // Mysql password
$db_name="guestbook"; // Database name 
$tbl_name="visitors"; // Table name 
// Connect to server and select database.
mysql_connect("localhost", "root", "ryubest")or die("cannot connect server "); 
mysql_select_db("guestbook")or die("cannot select DB");
$sql="SELECT * FROM visitors";
$result=mysql_query($sql);
while($rows=mysql_fetch_array($result)){
?>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td><table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td>ID</td>
<td>:</td>
<td><? echo $rows['guestid']; ?></td>
</tr>
<tr>
<td width="117">First Name</td>
<td width="14">:</td>
<td width="357">
<? echo $rows['fname']; ?></td>
</tr>
<tr>
<td width="117">Last Name</td>
<td width="14">:</td>
<td width="357"><? echo $rows['lname']; ?></td>
</tr>
<tr>
<td width="117">Visit Date</td>
<td width="14">:</td>
<td width="357"><? echo $rows['visitdate']; ?></td></tr>
<tr>
<td width="117">City</td>
<td width="14">:</td>
<td width="357"><? echo $rows['city']; ?></td></tr>
<tr>
<td width="117">country</td>
<td width="14">:</td>
<td width="357"><? echo $rows['country']; ?></td></tr>
<tr>
<td width="117">First Name</td>
<td width="14">:</td>
<td width="357"><? echo $rows['comments']; ?></td></tr>
<tr>
<td width="117">First Name</td>
<td width="14">:</td>
<td width="357"><? echo $rows['email']; ?></td></tr>
<?
}
mysql_close();
?>

I believe it has something to do with your short tags. It is best to use <?php ?> instead of <? ?>

changing the last <? to <?php fixes this:

<?php
}
mysql_close();
?>

thanks for the reply I was able to figure it out a different way

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.