You put the semicolon inside of your quotes for the query.
Try this:
$query = "SELECT surname FROM members";
$select = mysql_query($query, $db);
BTW, what are you doing about escaping the nested double quotes here:
echo "<option value = "$i">%s";
Maybe try this:
echo '<option value = "$i">%s';