Update database

This script will never be “online”, I am working on a few scripts to learn php and sql. I have a database to track medical billing records. This is my page that displays the data

<?php
$con = mysql_connect("localhost","root","**********");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
  print "";
 
mysql_select_db("medical", $con);
  $result = mysql_query("SELECT * FROM billing_records ORDER BY date_of_service");
// make box and name the fields in html
 
// fill box with data
while($row = mysql_fetch_array($result))
   {
  
  echo "Date:             " . $row['date_of_service'] . "<br />";
  echo "Doctor's Name:    " . $row['doctor_name'] . "<br />";
  echo "Service Provider: " . $row['service_provider'] . "<br />";
  echo "Insurance:        " . $row['insurance_provider'] . "<br />";
  echo "Bill Before:      " . $row['bill_before_insurance'] . "<br />";
  echo "Discount:         " . $row['insurance_discount'] . "<br />";
  echo "Insurance Paid:   " . $row['insurance_paid'] . "<br />";
  echo "What I Owe:       " . $row['what_i_owe'] . "<br />";
  echo "Comment's:        " . $row['comments'] . "<br />";
  echo "<a href='update.php?id=" .$row['id']. "'>Edit</a>";
  echo "<hr />";
  }

 
 

 
  mysql_close($con);
?>

and this is the page I am trying to update the record with

<?php
$id=$_GET['id'];
$con = mysql_connect("localhost","root","**********");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
  print "";
 
mysql_select_db("medical", $con);

$query=" SELECT * FROM billing_records WHERE id='$id'";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();

$i=0;
while ($i < $num) {
$date=mysql_result($result,$i,"date_of_service");
$doctor=mysql_result($result,$i,"doctor_name");
$service_provider=mysql_result($result,$i,"service_provider");
$inserance=mysql_result($result,$i,"insurance_provider");
$bill_before=mysql_result($result,$i,"bill_before_insurance");
$insurance_discount=mysql_result($result,$i,"insurance_discount");
$insurance_paid=mysql_result($result,$i,"insurance_paid");
$what_i_owe=mysql_result($result,$i, "what_i_owe");
$comments=mysql_result($result,$i, "comments");

<form action="updated.php" method="post">
<input type="hidden" name="ud_id" value="<?php echo $id; ?>">
Date: <input type="text" name="ud_date" value="<?php echo $date; ?>"><br />
Doctor: <input type="text" name="ud_doctor" value="<?php echo $doctor; ?>"><br>
Service Provider: <input type="text" name="ud_service_proviser" value="<?php echo $service_provider; ?>"><br>
Insurance Provider: <input type="text" name="ud_insurance" value="<?php echo $insurance; ?>"><br>
Bill Before Insurance: <input type="text" name="ud_bill_before" value="<?php echo $bill_before; ?>"><br>
Insurance Discount: <input type="text" name="ud_discount" value="<?php echo $insurance_discount; ?>"><br>
Insurance Paid: <input type="text" name="ud_insurance_paid" value="<?php echo $insurance_paid; ?>"><br>
What I Owe: <input type="text" name="ud_what_i_owe" value="<?php echo $what_i_owe; ?>"><br>
Comments: <input type="text" name="ud_comments" value="<?php echo $comments; ?>"><br>
<input type="Submit" value="Update">
</form>
<?php
++$i;
}
?>

I know that the <form> will not work like it is but am not sure how it should be set up. When I click on the edit button on one of the records it displays the proper id in the URL but it the page says Parse error: parse error in C:\wamp\www\Medical\update.php on line 29

You’re missing a ?> tag between these two lines


$comments=mysql_result($result,$i, "comments");
 
<form action="updated.php" method="post">