I'm trying to create a dropdown list with items from the mysql database. The problem is that my list is empty. I looked around but I could not find a solution.
$q = $db->getQuery(true);
$q->select('#__peaks.peak_name');
$q->from($db->quoteName('#__peaks'));
$db->setQuery($q);
$result = $db->loadColumn();
echo "<select name='peak_name'>";
echo "<option size =30 ></option>";
while($row = mysql_fetch_array($result))
{
echo "<option value='".$row['peak_name']."'>".$row['peak_name']."</option>";
}
echo "</select>";
Where am I wrong? Please help.