I am trying to populate drop down from mysql table. I am able to populate it successfully. But when I try to retrieve the data after submitting the form, I am not able to retrieve selected values. Can anyone help me on this?
$authorDB=new AuthorDB();
$myArr =$authorDB->retrieveAuthors();
echo '<tr>
<td rowspan="3"><div style="position: relative;">Author</div></td>
<td>
<select name="selAuthor" id="$selAuthor" multiple="multiple" size="3">';
foreach ($myArr as &$s_author)
{
echo '<option value='.$s_author.'>'.$s_author.'</option>';
}
'</select>
</td>
</tr>'
enter code here
and after submitting the form
$a_SelectedAuthors[]=$_POST["selAuthor"];
$nAuthors = count($a_SelectedAuthors);
echo '<h1> Count :'.$nAuthors.'</h1>';
for($i=0; $i < $nAuthors; $i++)
{
echo($a_SelectedAuthors[$i] . " ");
}