![]() |
Active records Distinct() Problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Active records Distinct() Problem (/showthread.php?tid=37131) |
Active records Distinct() Problem - El Forum - 12-29-2010 [eluser]Radiart[/eluser] Code: $this->db->distinct(); Why distinct not working? Quote: * HIP HOP GROOVE FESTIVAL 2010 radi Active records Distinct() Problem - El Forum - 12-29-2010 [eluser]jparent[/eluser] Yeah, I have the same problem. I think is a bug or we don't use it properly. Active records Distinct() Problem - El Forum - 12-29-2010 [eluser]InsiteFX[/eluser] Try moving $this->db->distinct(); below $this->db->select(); It should be below your select. InsiteFX Active records Distinct() Problem - El Forum - 12-29-2010 [eluser]Radiart[/eluser] [quote author="InsiteFX" date="1293652819"]Try moving $this->db->distinct(); below $this->db->select(); It should be below your select. InsiteFX[/quote] This changes nothing If it change something I use CodeIgniter version 1.7.3 Active records Distinct() Problem - El Forum - 01-02-2011 [eluser]Radiart[/eluser] There is an alternative? Active records Distinct() Problem - El Forum - 01-23-2011 [eluser]idealws[/eluser] I am not sure if you have found a fix for this or not. I thought I was having the same issue due to the profiler showing the results returned were 80295 which is the complete count for the table I was running the query on. When in fact there is only 51 being returned which is the proper number. However I came to find out it was working properly and the profiler is just reporting the wrong information. I am using CI 2.0 however which could have the fix for this issue already in it. Here is what my code looks like: Code: $abbr = array('AA','AE','AP','AS','DC','FM','GU','MH','MP','PR','PW'); Best Regards, Ray |