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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:40:05+00:00 2026-05-27T06:40:05+00:00

Im working on a pre created joomla component which using the MVC Architecture, My

  • 0

Im working on a pre created joomla component which using the MVC Architecture, My problem like this:

In Models i have a .php file with database fetch function as

defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.model' );


class class_name extends JModel
{

var $_data;

    function getlast_year(){
        $query = 'SELECT year FROM `table` ORDER BY year DESC LIMIT 0,1';
        $this->_db->setQuery( $query );
        return $this->_db->loadResult();
    }

}   

I added a new function to the same class file: (I have updated the table columns too in MVC /tables)

as:

function getAttendenceData()
{
    $query="SELECT id,octSec,octNin,octSect,octSec,octTwent FROM `table`";
        $this->_db->setQuery( $query );
        //$this->_data = $this->_db->loadObjectList();
        $this->_data = $this->_db->loadObject();
        return $this->_db->loadObjectList();
}

but in view i cant still access the fetched data from the above new function but older functions are working property

  • 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-27T06:40:06+00:00Added an answer on May 27, 2026 at 6:40 am

    This is not an actual answer but response to the comment.

    First in your view.html.php file, you’ll have to retrieve data from the model.

    $attendance_data = & $this->get('AttendenceData');

    This’ll give you the object list as you are returning from your getAttendenceData() function.

    Now assign it to a view variable (lets say data).

    $this->assignRef('data', $attendance_data);

    Now you can access this data in your view:

    foreach($data as $r)
    {
        echo $r->id;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

OK, I am working on developing a USB device. I have created a custom
I've been working with Google Maps API v3 and created a map which allows
I am using a payment method which on success returns a url like mysite/payment/sucess?auth=SDX53641sSDFSDF,
I have been working through some code and I would like to work out
I have been migrating from subversion to mercurial piecemeal and this has created a
I have created a WPF app where I dynamicly build XAML elements using c#
i have created below function in a file info.php to debug variable & data
I am working on a program which consists of two parts Service component will
Working with dates in ruby and rails on windows, I'm having problems with pre-epoch
I'm trying to get pre/post annotations working with a web application, but for some

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.