I tried many things but i just cant make the value of option an id from database and i cant write the option as date and title from database im doing this so far, any help would be appreciated.
<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>
mysql_*
functions, they are officially deprecated, no longer maintained and will be removed in the future. You should update your code with PDO or MySQLi to ensure the functionality of your project in the future. – kaᵠ Jun 12 at 3:28print_r($result);
to check what data is pouring in – swapnesh Jun 12 at 3:56