<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>PHP and MySQL are Friends</title>
  </head>

  <body>
  	<h1>Movies Made in 2000</h1>

  	<ul>
    <?php
		# connect to imdb_small database on local computer
		$db = mysql_connect("webster.cs.washington.edu", "jkmiller", "9v3nTBWiL2eBC");
		mysql_select_db("imdb_small");

		# execute a SQL query on the database
		$results = mysql_query("SELECT * FROM movies WHERE year = 2000");

		# loop through each result
		while ($row = mysql_fetch_array($results)) {
    ?>

    <li><?= $row["name"] ?></li>

    <?php
		}

		# clean up resources
		mysql_free_result($results);
		mysql_close($db);
    ?>

    </ul>
  </body>
</html>
