• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[solved] Get $this->db->distinct() to work

#1
[eluser]soamazing[/eluser]
Hi all,

I'm quite new to code igniter, but so far so good! I only now have a problem which I can't see to solve. Below i'm extracting some data in my model. It works fine, except for the distinct part...

Does anyone know where to place this distinct line, and how to distinct it on the collumn 'name'.

Code:
$this->db->select('name,id,image,category_id,pnumber');
    $this->db->distinct('name');
    $this->db->where('country_id',$countryid);
    $this->db->orderby('name','asc');
    $Q = $this->db->get('products');

At this moment this extraction works only I still get duplicates with the same name. (so the distinct part is not being done. Looks like it get skipped for some reason)

Many thanks in advance!

Rick


Messages In This Thread
[solved] Get $this->db->distinct() to work - by El Forum - 10-14-2008, 03:56 AM
[solved] Get $this->db->distinct() to work - by El Forum - 10-14-2008, 07:20 AM
[solved] Get $this->db->distinct() to work - by El Forum - 10-14-2008, 07:27 AM
[solved] Get $this->db->distinct() to work - by El Forum - 10-14-2008, 07:40 AM
[solved] Get $this->db->distinct() to work - by El Forum - 10-14-2008, 07:48 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.