title: Column 'id' in where clause is ambiguous
body: <p>I get this error and I can't figure out why?</p>
  
  <blockquote>
    <p>Error Number: 1052<br>
    Column 'id' in where clause is ambiguous</p>
  </blockquote>
  
  <pre><code>SELECT `leads`.*,
         `customers`.`id` AS customers_id,
         `customers`.`name` AS customers_name,
         `customers`.`company` AS customers_company,
         `customers`.`email` AS customers_email,
         `customers`.`phone` AS customers_phone,
         `customers`.`created_at` AS customers_created_at,
         `customers`.`updated_at` AS customers_updated_at,
         `customers`.`ip_address` AS customers_ip_addressFROM (`leads`)
  JOIN `customers` ON `customers`.`id` = `leads`.`customer_id`
  WHERE `id` = '3'
    AND `leads`.`id` = '1'LIMIT 1
  </code></pre>
  
  <blockquote>
    <p>Filename: /home/www/REMOVED/models/lead.php</p>
    
    <p>Line Number: 12</p>
  </blockquote>
  
  <p>The function looks like this:</p>
  
  <pre><code>function get($id)
  {
    $this-&gt;db-&gt;select('leads.*, customers.id AS customers_id, customers.name AS customers_name, customers.company AS customers_company, customers.email AS customers_email, customers.phone AS customers_phone, customers.created_at AS customers_created_at, customers.updated_at AS customers_updated_at, customers.ip_address AS customers_ip_address');
    $this-&gt;db-&gt;where('leads.id', '1');
    $this-&gt;db-&gt;from('leads');
    $this-&gt;db-&gt;join('customers', 'customers.id = leads.customer_id');
    $this-&gt;db-&gt;limit(1);
    $query = $this-&gt;db-&gt;get();
  
    if ($query-&gt;num_rows() == 1)
    {
      $result = $query-&gt;result();
      return $result[0];
    }
  }
  </code></pre>
  
  <p>And line 12 is <code>$query = $this-&gt;db-&gt;get();</code></p>
  
  <p>What is wrong?</p>