如何在select输入类型中使用函数

I need some help with using a function in a option value. I just started using/learning functions and wrote this :

*function selectNew($dbcon) {
  $sql = 'SELECT id, item, comment, date, time, important FROM item ORDER BY ASC id';
  foreach ($dbcon->query($sql) as $row) {
    print $row['item'] . "\t";
    print $row['comment'] . "\t";
    print $row['date'] . "
";
    print $row['time'] . "
";
    print $row['important'] . "
";
  }
}*

i want to use this in :

<table>
    <tr><th>Select by:</th><td><select>
      <option value="<?php selectNew ?>">Newest</option>
    </select></td></tr>
</table>

If i select this i want to echo the data from my database in ascending order by id.

Is this possible or do i need to do this in a other way?

Thanks,

You'll want to output your option tags from within the loop.

function selectNew($dbcon) {
  $sql = 'SELECT id, item, comment, date, time, important FROM item ORDER BY ASC id';
  foreach ($dbcon->query($sql) as $row) {
    echo "<option>";
    print $row['item'] . "\t";
    print $row['comment'] . "\t";
    print $row['date'] . "
";
    print $row['time'] . "
";
    print $row['important'] . "
";
    echo "</option>";
  }
}

<table>
    <tr><th>Select by:</th><td><select>
      <?php selectNew($dbConn); ?>
    </select></td></tr>
</table>