title: How to concatenate results in a string when they have the same value?
body: <p>I have a database table that I'm accessing using PHP. The table contains three columns: <code>id</code>, <code>name</code>, <code>group</code>.
  Here's an example of the content of the table:</p>
  
  <pre><code>------------------------------------------------------
  | id   | name   | group                              |
  ------------------------------------------------------
  | 1    | Lucy   | 1                                  |
  | 2    | Jane   | 1                                  |
  | 3    | Emily  | 2                                  |
  | 4    | Anne   | 1                                  |
  | 5    | Kim    | 3                                  |
  | 6    | Carrie | 3                                  |
  ------------------------------------------------------
  </code></pre>
  
  <p>I access my table in PHP like this:</p>
  
  <pre><code>SELECT * FROM table
  </code></pre>
  
  <p>I'd like to generate the following strings, one string per group:</p>
  
  <blockquote>
    <p>Lucy, Jane and Anne are group 1 (Lucy's id is 1, Jane's id is 2,
    Anne's id is 4). </p>
    
    <p>Emily is group 2 (Emily's id is 3). </p>
    
    <p>Kim and Carrie
    are group 3 (Kim's id is 5, Carrie's id is 6).</p>
  </blockquote>
  
  <p>What PHP function can I use to I generate these strings automatically from the content of my table? </p>