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 8251015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:06:04+00:00 2026-06-08T00:06:04+00:00

I have a function to get a single user from the database so I

  • 0

I have a function to get a single user from the database so I can show it, for user profiles and stuff.

Well I want to be able to have a seperate table just for groups, so I can add more if I want to and it be simple. So I have a group_id field in the users table so I can do that, and it would join the groups table with the groups id column.

Well I was able to do it successfully for another project of mine, but when I moved the function over to this current project (I’m using the same EXACT methods to display the profile on both projects) it no longer works… keeps returning nothing at all…

public function getUser($username) {
    if (empty($username)) {
        return false;
    }
    $this->ci->db->from('users');
    $this->ci->db->join('groups','users.group_id = groups.id');
    $query = $this->ci->db->where('username',$username)->get();

    $user = $query->row();

    return $user;
}

That is the function, could someone please help me as to why it’s not working? I have tried it in the controller, the model, and the library, and none of them are working.

  • 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-08T00:06:06+00:00Added an answer on June 8, 2026 at 12:06 am

    I feel stupid, but anyway I found the issue.

    I forgot to actually add a value into the column for that specific user for the group_id

    So the group_id in the column was 0, when it needed to be at least 1 or higher, after changing it, it worked just fine…

    Thanks for all of your help tho, both of you.

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

Sidebar

Related Questions

I have a function where I get input from a user def get_single_argument(argument,name) begin
I have a function that get the current weeknumber from the given date e.g.
hi i have a function that get information from xml data and print markers
I have a function: window.onbeforeunload = function () { $.get(Handler.ashx, mode=saveuser&user= + $(#username).text(), function
How can I get mcc to recognize imports from user-provided Java libraries, or to
I have a function that shows a map page so I can get the
I have a function where I get a list of ids, and I need
I have to implement a function to get headers only (without doing a GET
I have a function witch is written in an imperative style and cant get
I want to use the newton function loaded as from scipy.optimize import newton in

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.