title: Get all the values from single column in MySQL PDO
body: <p>I have value in <code>user_id</code> column (1,47,6). How to get all the values? </p>
  
  <p>I have used following code.</p>
  
  <pre><code>$array_data = array($project_id);               
  $query = "SELECT * FROM p
      INNER JOIN pl ON p.pl_id = pl.pl_id
      INNER JOIN user ON p.user_id = user.user_id WHERE 
      p.p_id=?";
  $stmt = $conn-&gt;prepare($query);
  $stmt-&gt;execute($array_data);
  $result_data = $stmt-&gt;fetchAll( PDO::FETCH_ASSOC );
  $ids = array();         
  foreach($result_data as $rows) {
  
      $ids[] = $rows['user_id'];                      
  
  }
  $id = implode(',',$ids);
  echo $id;
  </code></pre>
  
  <p>This <code>$id</code> returns only the first value (1). I need all 3 values. Please help &amp; thanks in advance.</p>