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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:07:36+00:00 2026-06-12T19:07:36+00:00

i have controller to show database record on table function gkategorimaterial() { $this->load->model(‘m_kategorimaterial’); $data[‘kirim’]

  • 0

i have controller to show database record on table

function gkategorimaterial()
{
    $this->load->model('m_kategorimaterial');
    $data['kirim'] = $this->m_kategorimaterial->read(); //error pointing on this line
    $data['title'] = 'QB Ambil Kategori Material / Jasa';

    $this->load->view('head',$data);
    $this->load->view('g/gkategorimaterial',$data);
}

that gkategorimaterial() was adapted from

function vkategorimaterial()
{
    $this->load->model('m_kategorimaterial');

    $data['kirim'] = $this->m_kategorimaterial->read();
    $data['title'] = 'QB Kategori Material';

    $this->load->view('head',$data);
    $this->load->view('v/vkategorimaterial',$data);
}

which has the some function, to show the table, the vkategorimaterial() success to retrieve the record.

here is the model of `m_kategorimaterial

function read()
{
    $query = $this->db->order_by('Kode_Kategori_Material_Jasa','DESC');
    $query = $this->db->get('ms_kategori_material');

    if($query->num_rows()>0)
    {     
        return $query->result();
    }
    else
    {
        return null;
    }
}

A PHP Error was encountered

Severity: Notice

Message: Undefined property: C_materialjasa::$m_kategorimaterial

Filename: controllers/c_materialjasa.php

Line Number: 140

i believe it has nothing to do with the models, but i don’t know what the error is, since i just copy paste the first controller which is vkategorimaterial() controller, and rename the variable

  • 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-12T19:07:38+00:00Added an answer on June 12, 2026 at 7:07 pm

    Are database loaded on m_kategorimaterial?

    $this->load->database(); 
    

    or set in ./application/config/autoload.php

    $autoload['libraries'] = array('database');  
    

    Or try add parent in controller:

    function __construct()
    {
        parent::__construct();
    }
    

    Loading a model:

    Controller:

    $this->load->model('Model_name');
    

    Model (‘models/Model_name.php’)

    class Model_name extends CI_Model {
    
        function __construct()
        {
        parent::__construct();
        }
    
            function read() { return; }
    }
    

    Make sure that is model file CHMOD-ed to 0755!

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

Sidebar

Related Questions

I have three table views inside a view controller (going to show/hide table views
I need show record from database. But I have a error: 'object' does not
I have an application that shows some data in p:DataTable.... This table is accessible
I need help with validation error in database. I have a model : function
I have a problem,i have to retrieve the data from database and show it
I'm using core data and I have a simple two-entity model. My navigation controller
I have a model in my database whose 'show' action is open to viewing
i have view controller which contains a button which show the image library ,if
I have a controller returning a json structure like so: def show # .......
I have controller and model. i am modifying a variable value in a model,

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.