<?php
$db = new PDO("mysql:host=localhost;dbname=imdb_small", "siskel", "2thumbsup");
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $db->prepare("SELECT * FROM movies WHERE year = :year");
$stmt->execute(array(":year" => $_REQUEST["year"]));
?>

<h1>Movies Made in <?= $_REQUEST["year"] ?></h1>
<ul>
  <?php foreach ($stmt as $row) { ?>
    <li> <?= $row["name"] ?> got a score of <?= $row["rank"] ?> </li>
  <?php } ?>
</ul>
