Hello,
I am running a query to populate a dropdown menu, however the column I am using a list of company names, this means that the company name is often repeated, is there way to only get each repeated value only once? So for instance if I have in the table something like,
Company 1
Company 1
Company 2
Company 3
Company 4
Company 4
But I would like the dropdown to return,
Company 1
Company 2
Company 3
Company 4
I am using the database libray and active record to write the sql like this currently I need to know what I use to only show each result once,
function getAllUsers() {
$this->db->select('*');
$this->db->from('userProfileTable');
$query = $this->db->get();
return $query->result_array();
}
Or what would the raw sql be?