$this->db->distinct() help needed - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: $this->db->distinct() help needed (/showthread.php?tid=8255) |
$this->db->distinct() help needed - El Forum - 05-12-2008 [eluser]Computerzworld[/eluser] Hello. I want to use $this->db->distinct on a particular column lets say trainId. How can I use it? I have passed trainId as parameter like this. $this->db->distinct('trainId') but it didn't returned me distinct result. Here is the exact code which I have written. Code: $this->db->distinct('trainId'); $this->db->distinct() help needed - El Forum - 05-12-2008 [eluser]gtech[/eluser] you don't pass a parameter like that into distinct.. this is the function in the active record code Code: function distinct($val = TRUE) Code: $sql = ( ! $this->ar_distinct) ? 'SELECT ' : 'SELECT DISTINCT '; so distinct only takes TRUE or FALSE as a parameter, and the default is TRUE if nothing is passed in. hope this helps you. |