PHP and mysql multiple select dropdown
<p>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?</p>

<pre><code>$authorDB=new AuthorDB();
$myArr =$authorDB-&gt;retrieveAuthors();
echo '&lt;tr&gt;
&lt;td rowspan="3"&gt;&lt;div style="position: relative;"&gt;Author&lt;/div&gt;&lt;/td&gt;
&lt;td&gt;
&lt;select name="selAuthor" id="$selAuthor" multiple="multiple" size="3"&gt;';
foreach ($myArr as &amp;$s_author)
{
echo '&lt;option value='.$s_author.'&gt;'.$s_author.'&lt;/option&gt;';
         }
'&lt;/select&gt;
&lt;/td&gt;
&lt;/tr&gt;'

enter code here
</code></pre>

<p>and after submitting the form</p>

<pre><code>$a_SelectedAuthors[]=$_POST["selAuthor"];
$nAuthors = count($a_SelectedAuthors);
echo '&lt;h1&gt; Count :'.$nAuthors.'&lt;/h1&gt;';
for($i=0; $i &lt; $nAuthors; $i++)
{
    echo($a_SelectedAuthors[$i] . " ");
}
</code></pre>
