title: PHP MYSQL RETURN ARRAY IN A FIELD
body: <p>I'm a little confused how to start this.  I have a table of attribute names and then a table of attribute field names.  As such</p>
  
  <pre><code>**Table: attributes**
  id
  name
  
  **Table: attributes_fields **
  id
  attrID
  fieldname
  </code></pre>
  
  <p>The attrFields can have multiple records attached to a single attr.  I'm trying to get the output something like so.</p>
  
  <pre><code>Name    Fields (comma separated field id's)
  9       1,3,4,5
  </code></pre>
  
  <p>So far I have this.</p>
  
  <pre><code>SELECT * 
  FROM attributes 
      LEFT JOIN attributes_fields on attributes.attributeID = attributes_fields.attributeFieldParentID
  WHERE attributes.attributeID = 9
  </code></pre>
  
  <p>Which works, but not as I would like it.  I'm looking for one row to be returned.  The above returns all the fields as multiple rows.</p>
  
  <p>Any help would be great.</p>
  
  <p>Thanks!</p>