title: Implode ids within a while loop and add commas between
body: <p>I'm trying to display some sub-content so I need to get the child id's of their parent.</p>
  
  <p>This is how I wanted to do it:</p>
  
  <pre><code>$ids        = "SELECT * FROM `web_categories` WHERE parent_id = 14 AND published = 1";
  $idscon     = $conn-&gt;query($ids);
  while ($ids = $idscon-&gt;fetch_array()){
      $idss .= $ids['id'];
  }
  
  $project1       = "SELECT * FROM `web_content` WHERE catid in ('$idss') AND state = 1";
  $projectcon1    = $conn-&gt;query($project1);
  $projectcr1     = array();
  while ($projectcr1[] = $projectcon1-&gt;fetch_array());
  </code></pre>
  
  <p>I tried imploding <code>$idss</code> like this:</p>
  
  <pre><code>$implode = implode(',', $idss);
  </code></pre>
  
  <p>But this gives me <code>Invalid arguments passed</code>. What am I doing wrong?</p>