title: Fetch multiple rows in join
body: <p>I have a bit of trouble with the following sql...</p>
  
  <p>First step is:</p>
  
  <p>Fetch one row from a table an join multiple rows from another table... the result array should look like this:</p>
  
  <pre><code>array(
    field_1, 
    field_2, 
    field_3, 
    joined_array(
      field_a_array(
        field_a_a, 
        field_a_b, 
        field_a_c
      ), 
      field_b_array(
        field_b_a, 
        field_b_b, 
        field_b_c
      )
    ) 
  ) 
  </code></pre>
  
  <p>My query looks something like this: </p>
  
  <pre><code>SELECT table_1.*, table_2.*
  FROM table_1
  JOIN table_2 ON table_2.field_1 = table_1.field_1
  WHERE table_1.field_1 = xyz
  </code></pre>
  
  <p>But it returns only one row from the "table_2"...</p>
  
  <p>So, what am I doing wrong ?</p>
  
  <p>Edit because of comment #1:</p>
  
  <p>The above query is not the actual query, only a rewrite of me.</p>
  
  <p>I use codeigniter as framework, so the query is build by a codeigniter class... the code for the query is the following:</p>
  
  <p>(it seems that the position of where, join, etc isn't important for the codeigniters db class)</p>
  
  <pre><code>$this-&gt;db-&gt;select('events.*, genres_x_events.*');
  
  $this-&gt;db-&gt;from('events');
  $this-&gt;db-&gt;where('events.slug', $slug);
  $this-&gt;db-&gt;where('events.deleted', 0);
  
  $this-&gt;db-&gt;join('genres_x_events', 'genres_x_events.event_slug = events.slug');
  
  $query = $this-&gt;db-&gt;get();
  </code></pre>