我尝试了很多事情,但我无法将选项的值设为数据库中的 id,并且我无法将选项写为数据库中的日期和标题,我目前正在这样做,任何帮助将不胜感激。
<select name="agenda "size="10">
<?php
global $connection;
$result = mysql_query("SELECT * FROM agenda where date > now() order by date", $connection);
$i = 0;
while ($row = mysql_fetch_array($result) && $i < 20)
{
$id = $row['id_agenda'];
$date = $row['date'];
$title = $row['title'];
//here i would like to make an option with
//value = id_agenda and write the date_agenda and title_agenda
//something like this
//<option value="$row[$id]">$date $title</option>
$i++;
}
?>
<option value="Google">meeting 2</option>
</select>