// retrieve parameter value from query string $id = $_GET['id']; /* method 1 – notice the ? parameter */ $sql = "SELECT Title, CopyrightYear FROM Books WHERE ID = ?"; $statement = $pdo->prepare($sql); $statement->bindValue(1, $id); // bind to the 1st ? parameter $statement->execute(); /* method 2 */ $sql = "SELECT Title, CopyrightYear FROM Books WHERE ID = :id"; $statement = $pdo->prepare($sql); $statement->bindValue(':id', $id); $statement->execute();