title: implode or explode mysql_fetch_array in php
body: <p>Hi guys. 
  I'm currently try to make an mysql query than take the results and use them in an another query. So I thought I'm calling my database and use mysql_fetch_array and than implode it do insert <code>,</code> so I can use it in an another query. I read here many questions about this and based on the questions i wrote my own piece of code but I'm getting this error: </p>
  
  <pre><code>Warning: array_values() expects parameter 1 to be array, string given in /var/www/html/lager_management/warenkorb.php on line 107
  
  Warning: implode(): Invalid arguments passed in /var/www/html/lager_management/warenkorb.php on line 108
  </code></pre>
  
  <p>Here is the piece of code what is going wrong I can't explain myself and I know <code>mysql</code> is old and I should use <code>myqli</code></p>
  
  <pre><code>$sql3 = "SELECT `Index` FROM lm_Warenkorb;";
          $result3 = mysql_query($sql3);
          while($resultarray3 = mysql_fetch_array($result3)) 
          {
          $anfrage = array();
          $anfrage = $resultarray3['Index'];
          $anfrage = implode(", ", $anfrage); 
  
            $sql2 = "SELECT `Index`, `Artikelbezeichnung`, `Status`, `Bestand`, `Lieferant`, `Datum-Einlagerung`, `Lagerort` FROM `lm_Artikel` WHERE `Index` IN (".$anfrage.");";
          }
  </code></pre>
  
  <p>The table lm_Warenkorb looks like this:</p>
  
  <pre><code>Index:
      10
      2
      6
  </code></pre>