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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:33:10+00:00 2026-06-16T04:33:10+00:00

Here is my Model: function get_name() { $this->db->select(‘first_name’); $this->db->where(’email’, $this->session->userdata(’email’)); $query = $this->db->get(‘users’); if($query->num_rows()

  • 0

Here is my Model:

function get_name() {
    $this->db->select('first_name');
    $this->db->where('email', $this->session->userdata('email'));
    $query = $this->db->get('users');

    if($query->num_rows() == 1) {
        return true;
    }
}

and this is my controller method:

function show_name() {
    $this->load->model('users_model');
    $this->users_model->get_name();
    }

and the method that passes a name to view:

function profile(){
    $data['first_name'] = $this->show_name();
    $this->load->view('members/template', $data);
}

I get nothing in the view, I checked my query and it works fine. Is there anything I’m missing?

  • 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-16T04:33:12+00:00Added an answer on June 16, 2026 at 4:33 am

    You need to update your code. You need to return first_name from the function get_name

    function get_name() {
            $this->db->select('first_name');
            $this->db->where('email', $this->session->userdata('email'));
            $query = $this->db->get('users');
    
            if($query->num_rows() == 1) {
                return $query->row()->first_name;
            }
        }
    

    You also need to return the value from function show_name

    function show_name() {
        $this->load->model('users_model');
        return $this->users_model->get_name();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my model public function getDetails($ip) { $this->db->select('country_code, country_name'); $this->db->where('2323' BETWEEN begin_ip_num AND
I have the following query, which returns a single row. MODEL: function get_guide_first(){ $this->db
Here's my model: public class StockRequestModel { public int StockID { get; set; }
Here is my controller : class Comment extends CI_Controller { function article() { $this->load->library('pagination');
I am using codeIgniter and am really stucked on it. Here's my model function
an update from my previous question.. this is my code in the model. function
using this example on dynamic list https://github.com/sandeepleo11/Dynamic-Select-Menus-in-Rails-3 I managed to get dynamic select in
Here is my model: public class RestoreRequestModel : IDataErrorInfo { //true seems Value contains
Here's sample model classes, which being use with Entity Framework Code First: public class
Here is my Model View and Collection : window.Report = Backbone.Model.extend({}); window.ReportCollection = Backbone.Collection.extend({

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.