Imploding an array issue in php
<p>I have this code above which i use to implode some variable. 
The issue is that i need to create the same thing for <code>$hostess_name[]</code> as i did for  <code>$hostess_id_selected[]</code>.
I don't know what am i doing wrong.
I need to implode it the same way as i did with <code>$hostess_id_selected1</code></p>

<pre><code> foreach($hostess_id as $val) {
   $hostess_id_selected[] = $val;
   $sqlnomehostess="SELECT nome_hostess FROM hostess where id='$val'";
   $resultnomehostess=mysql_query($sqlnomehostess)or die(mysql_error());
   $hostess_name= array();

   while ($row=mysql_fetch_array($resultnomehostess,MYSQL_ASSOC)) {
     $hostess_name[] = $row['nome_hostess'];
   }
 }

 $hostess_id_selected1 = implode("-",$hostess_id_selected);
</code></pre>
