title: Left join in codeigniter
body: <p>I have 3 tables,</p>
  
  <pre><code> itemmaster
  |--------|----------|
  |  id    |   name   |
  |--------|----------|
  |   1    |   Pizza  | 
  |--------|----------|
  |   2    |   Burger | 
  |--------|----------|
  |   3    |   Pepsi  | 
  ---------------------
  
       order
      |--------|----------|
      |orderid |   date   |
      |--------|----------|
      |   1    |   1-1-11 | 
      |--------|----------|
      |   2    |   2-1-11 | 
      |--------|----------|
      |   3    |   3-1-11 | 
      ---------------------
  
  
            orderdetails
          |--------|-------------|---------|---------|
          |  id    |   orderid   |itemid   |quantity |
          |--------|-------------|---------|---------|
          |   1    |   1         | 1       | 10      |
          |--------|-------------|---------|---------|
          |   2    |   1         | 2       | 20      |
          |--------|-------------|---------|---------|
          |   3    |   2         | 1       | 10      |
          -------------------------------------------
  </code></pre>
  
  <p>I want to join these 3 tables to get quantity of items of an order that placed on a particular date.
  What I have tried is </p>
  
  <pre><code>$this-&gt;db-&gt;from('itemmaster');
  $this-&gt;db-&gt;join('orderdetails', 'orderdetails.itemid= itemmaster.id','left');
  $this-&gt;db-&gt;join('order', 'order.orderid= orderdetails.orderid');
  $this-&gt;db-&gt;where('order.date',"1-1-11");            
  $query = $this-&gt;db-&gt;get();
  </code></pre>
  
  <p>I got Result as,</p>
  
  <pre><code>Pizza------ 10
  Burger------10
  </code></pre>
  
  <p>What I want is,</p>
  
  <pre><code>Pizza-------10
  Burger------20
  Pepsi-------0
  </code></pre>