title: Array to string conversion error
body: <p>I have a query that's pulling a list of IDs. Those IDs are in an array and I need to search another table with those IDs. I tried using implode to make those IDs a string that I could use in a where clause but I keep getting this error. </p>
  
  <p>My current code is: </p>
  
  <pre><code> $query = $this-&gt;db-&gt;query('
          SELECT *
          FROM system_scoperights
          WHERE user = '. $this-&gt;session-&gt;userdata('username') .'
      ');
  
      foreach ($query-&gt;result() as $row) {
          $scope = $row-&gt;site;
          $data[] = $scope;
      } 
      $dataScope[] = $data;
  
      $idList = implode(',', $dataScope);   &lt;---- Error Line
  
      $where = 'WHERE scope_scopes.sc_ID IN '. $idList .'';
  </code></pre>
  
  <p>I've tried different things I found on forums like:</p>
  
  <pre><code> $idList = implode(',', array_values($dataScope));
  </code></pre>
  
  <p>and </p>
  
  <pre><code> $idList = implode(',', join($dataScope));
  </code></pre>
  
  <p>but none of those work. (I've never even heard of the join function)</p>
  
  <p>Thanks in advance for the help.</p>