PHP将格式化日期(仅月份和年份)填充到下拉列表中,但删除重复项

Im trying to get the dates from the DB, store only the months and years of them into a var, populate the drop drown list with the results, but delete any duplicate month and year.

For example my drop down list is displaying:

  • Jun 14
  • Jun 14
  • Jul 14
  • Aug 14
  • Aug 14
  • Aug 14
  • Sep 14
  • Jan 15
  • Feb 15
  • Jun 15
  • Jun 15

And I only want it do to display one month (with year) each option.

Here's my code:

            <select name="month">
                <?php
                    $sSDate = "SELECT DISTINCT eventStartDate FROM te_events GROUP BY eventStartDate ORDER BY eventStartDate ASC";
                    $qrSDate = mysql_query($sSDate) or die (mysql_error());
                    while($rowSDate = mysql_fetch_assoc($qrSDate))
                    {
                        $s_event_start_date = $rowSDate ['eventStartDate'];

                        $sGetStartDate = strtotime($s_event_start_date);
                        $sFormattedStartDate = date('M y', $s_event_start_date );

                        echo '
                        <option value="'.$sFormattedStartDate.'">
                            '.$sFormattedStartDate.'
                        </option>
                        ';
                    }
                ?>
            </select>

Use sql: Select distinct Year(eventStartDate), month(eventStartDate) from ...