title: post values from a multiselect list to a mysql query using php and jquery
body: <p>Hi guys I am trying to post values which is getting number from another text box for MySQL select query but i am stuck can u please help me here is my code when I try to get result I cannot add comma(,) between values. also tried implode() and explode() function but the result only got number of array element please help me. I will be glad to try your ideas thanks.
  on my sql query i get only row as a result which is my first select
  thanks a lot for your help again guys</p>
  
  <pre><code>function exportselectionlist(){
  var qcolumns=document.getElementById('selectionlist');
  for (i=0; i &lt; qcolumns.length; i++) {
  qcolumns.options[i].selected = true;
  }
  document.selectionlist_form.submit();
  }
  
  &lt;form id="selectionlist_form"  action="xxx.php" method="post"
   name="selectionlist_form"&gt;                         
  
      &lt;select id="selectionlist"  style="width:300px;" multiple="multiple" size="4" 
  name="selectionlist[]"&gt; 
  &lt;option value=""&gt;&lt;/option&gt;
  &lt;option value=""&gt;&lt;/option&gt;
  &lt;option value=""&gt;&lt;/option&gt;
  &lt;option value=""&gt;&lt;/option&gt;
  &lt;/select&gt;
  &lt;input type="submit" value="x" /&gt;
  &lt;a onclick="exportselectionlist()" href="javascript:;"&gt;Export&lt;/a&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>//xxx.php </p>
  
  <pre><code>    &lt;?php   foreach ($selectionlist as $value) {
  
      $resultstr = array();
  foreach ($selectionlist as $result)
    $resultstr[] = $result;
  
  echo $x=implode(",",$resultstr);
  
  sql = mysql_query("SELECT * FROM table where idArticle in ('$x')"); 
  </code></pre>