Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 619683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:40:54+00:00 2026-05-13T18:40:54+00:00

I am running a query to populate a dropdown menu, however the column I

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:40:55+00:00Added an answer on May 13, 2026 at 6:40 pm

    Use:

    $this->db->distinct();
    $this->db->select('*');
    $this->db->from('userProfileTable');
    $query = $this->db->get();
    return $query->result_array();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble running a complex query against our company LDAP server. I'm using
I have a long running query that returns a large data set. This query
I am running a query against a providex database that we use in MAS
I'm running an SQL query against a mainframe DB2 database using the OdbcDataReader class
When I'm running this query on my page, I'm getting a Subqueries are not
I currently have the query running on Postgres: SELECT * FROM addenda.users WHERE users.username
My Server is located in US and I am running a query against it.
I'm running the following query in Hypersonic DB (HSQLDB): SELECT (CASE foo WHEN 'a'
Is there any way to use AppleScript (or something else) to query currently running
After running a insert or update query against a SQLServer 2005 database, under what

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.