在php和mysqli创建的下拉列表中删除不需要的对象

I've created a piece of code that dynamically create objects within the select table.

These objects are years, however because of the mysql database there are multiple of the same year and therefore adding in unnecessary data when retrieved through php.

CODE:

$searchYearSQLI = "SELECT bookYear FROM nbc_book ORDER BY bookYear";

$querySearchYear = mysqli_query($dbCon, $searchYearSQLI) or die(mysqli_error($dbCon));

while($searchYear = mysqli_fetch_array($querySearchYear)){

$displayYear = $searchYear['bookYear'];

echo "<option value=\"$displayYear\">$displayYear<option>
";
} 

OUTPUT:

<option value="1998">1998</option>
<option value="1998">1998</option>
<option value="1999">1999</option>
<option value="2000">2000</option>
<option value="2001">2001</option>
<option value="2002">2002</option>
<option value="2002">2002</option>
<option value="2002">2002</option>
<option value="2002">2002</option>
<option value="2003">2003</option>
<option value="2003">2003</option>
<option value="2004">2004</option>
<option value="2004">2004</option>
<option value="2004">2004</option>
<option value="2004">2004</option>
<option value="2004">2004</option>
<option value="2004">2004</option>
<option value="2004">2004</option>

Is it possible to reduce these duplicate outputs and still have them point to the correct data within the database?

Just use DISTINCT function

$searchYearSQLI = "SELECT DISTINCT(bookYear) FROM nbc_book ORDER BY bookYear";

Change to:

$searchYearSQLI = "SELECT DISTINCT bookYear FROM nbc_book ORDER BY bookYear";