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

  • SEARCH
  • Home
  • 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 8923285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:04:48+00:00 2026-06-15T07:04:48+00:00

I have this function for getting users from database : function get_users_limited($offset, $limit) {

  • 0

I have this function for getting users from database :

function get_users_limited($offset, $limit)
{
    $q = $this->db->select('*')
              ->from('users')
              ->join('user_profiles', 'user_profiles.user_id = users.id'  )
              ->order_by('users.username asc')
              ->limit($limit, $offset)
              ->get();
    return $q;
}

And I want to order the results by username asc, but the problem is that it makes difference between A and a and B and b etc.

The problem is that the result looks like this:

Albert
Bob
Caesar
axnGuy
blackboy83
c3p0

and I want this:

Albert
axnGuy
Bob
blackboy83
Caesar
c3p0

Any advice how to ingnore lowercase and uppercase in CodeIgniter?

I need CI specific solution!

  • 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-06-15T07:04:49+00:00Added an answer on June 15, 2026 at 7:04 am

    I’m not familiar with your php there, and you don’t specify what charset you’re using. Also, it’s not specifically mentioned, but I assume we’re talking MySQL here.

    Assuming MySQL, suppose you’re using a charset of utf8.

    You can choose a different collation (valid for utf8) in your select such as

    SELECT `name` COLLATE utf8_unicode_ci as `name` FROM `owners`;
    

    Here the table is utf8 charset, and I use the utf8_unicode_ci (ci for case insensitive) collation mode on the name column.

    If you were using the default charset of latin1 you’d do something more like:

    SELECT `name` COLLATE latin1_general_ci as `name` FROM `owners`;
    

    etc.

    Totally unfamiliar with your PHP, but I’d assume it’d look something like this:

    function get_users_limited($offset, $limit)
    {
        $q = $this->db->select('users.username COLLATE latin1_general_ci as c1, user_profiles.* ')
                  ->from('users')
                  ->join('user_profiles', 'user_profiles.user_id = users.id'  )
                  ->order_by('c1 asc')
                  ->limit($limit, $offset)
                  ->get();
        return $q;
    }
    

    Specifying the collation subset of your charset doesn’t set or change the default collation on that column/table.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this function where I am getting the name of a Venue: var
I have created a custom function and I am getting this error. I dont
I have a function which creates an object of values, but im getting this
I have this code : include(connect.php); // Call database function $p = 100; $sth
I have a Jquery Function that basically retrieves a list of users from the
I have this function // add history paths and save data function AddPath( strTag,
I have this function: int firstHeapArray (IntHeapArray h) { if(!emptyHeapArray(h)) return h.array[0]; } It's
I have this function to create a request to another file to update the
I have this function: function validate($data) { $newData = str_replace( , , $newData); $newData =
I have this function that I would like to condense into some iterator. How

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.