我如何写html,而在php内部使用fetch_array数据


How can I write html in while inside php using fetch_array data?

我尝试了很多事情,但我只是不能使选项的值从数据库的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>

使用说明:

echo "<option value='"$id'">$date $title</option>";

while ($row = mysql_fetch_array($result)) {
    echo "<option value='"$row[id_agenda]'">$row[date] $row[title]</option>";
}