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,