mysql connect, display table data

<?php
  $link = mysql_connect("mysql_host", "mysql_login", "mysql_password")
   or die ("Could not connect to MySQL");

 mysql_select_db ("my_database")
   or die ("Could not select database");
   $result = mysql_query ("SELECT * FROM my_table")
  or die ("Query failed");

// printing HTML result

print "<table><br>";
while ($line = mysql_fetch_array($result)) {
  print "       <tr><br>";
  while(list($col_name, $col_value) = each($line)) {
    print "             <td>$col_value</td><br>";
  }
  print "       </tr><br>";
}
print "</table><br>"; ?>