while循环中的选项标记在php的下拉框中无法正常工作[关闭]

I am trying to allocate options in drop down box using while loop. The options appear blank on the page. No errors shown.

<?php 
$dbstate = new DB();
if (!$dbstate->open()) {
die ($dbstate->error());
    }
if (!$dbstate->query("SELECT * FROM external_details order by external_id")) {
      die ($dbstate->error());
    }
?>
<select name="selstate" >
<option value="0">Subject</option>
<?php   while ($row = $dbstate->fetchAssoc()) {?>           
    <option value="<?= $row['external_id']?>">
    <?= $row['name']?>
        </option>
<?php
     }
$dbstate->freeResult();
$dbstate->close();
?>

Either enable the short_open_tags option in your php.ini, or change <?= to <?php echo