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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:46:53+00:00 2026-06-14T03:46:53+00:00

an update from my previous question.. this is my code in the model. function

  • 0

an update from my previous question..

this is my code in the model.

function member_here()
{
$this->db->select('');
$this->db->from('membership');
$this->db->where('username',$this->input->post('username'));

$q=$this->db->get();

if($q->num_rows() > 0) {
$data = array('first_name');
foreach($q->result() as $row) {
    $data=$row;
}
return $data;
}
}

and this is my code in the view form:

<?php


$CI =& get_instance();
$CI->load->model('membership_model');
$result = $CI->membership_model->member_here();
print_r($result);
?>

now. i have a problem.

the output is this:

stdClass Object ( [id] => 10 [first_name] => Marishka [last_name] => Villamin [username] => marishkapv [password] => 01aef487205966f24dd694ca4153ccbb [email_address] => marishkapv@gmail.com )

i dont need that output. instead i want my output to be Marishka which is the value of the first_name field.

help please

  • 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-14T03:46:54+00:00Added an answer on June 14, 2026 at 3:46 am
    echo $result->first_name;
    

    You just need to echo out the part of the object you want, not the entire object. And for the record you shouldn’t be getting any data from the model in the view, that should all be done in the controller.

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

Sidebar

Related Questions

This code is taken from a previous question, but my question directly relates to
I had this code from a previous question, but its not compiling: public interface
This is the new code with the update from capdragon, but now it would
In a previous question i made Dynamic dependent select menus i posted this example
This is related to my previous question . I'm trying, in Excel, to update
this is an update to the previous question that I had about locating peaks
My question deals with my next/previous buttons. I can get my update/delete buttons to
This is a follow up to my previous question about using XMLHttpRequest() to post
Coming from this previous question: Using Obscure and UnObscure...Am I doing this right? 1:
I was inspired by this previous question, but I didn't get the whole picture.

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.