Organizational Research By

Surprising Reserch Topic

codeigniter how to do a select distinct fieldname mysql query using -'php,mysql,codeigniter,distinct'


codeigniter how to do a select distinct fieldname mysql query  using -'php,mysql,codeigniter,distinct'

I'm trying to retrieve a count of all unique values in a field.

Example SQL:

SELECT count(distinct accessid) FROM (`accesslog`) WHERE record = '123'


How can I do this kind of query inside of CodeIgniter?

I know I can use $this->db->query(), and write my own SQL query, but I have other requirements that I want to use $this->db->where() for. If I use ->query() though I have to write the whole query myself.
    

asked Sep 7, 2015 by rajesh
0 votes
80 views



Related Hot Questions

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

...