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

The Archive Base Latest Questions

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

below is my books_controller.php function books_s() { $this->load->helper(‘form’); $this->load->helper(‘html’); $this->load->model(‘books_model’); $sri=$this->input->post(); print_R($sri); if($this->input->post()) {

  • 0

below is my books_controller.php

function books_s()
{
    $this->load->helper('form');
    $this->load->helper('html');
    $this->load->model('books_model');

    $sri=$this->input->post();
    print_R($sri);

    if($this->input->post())
    {
    $bookme=$this->load->books_model->post_books(); 

    }
    $this->load->view('header.php');    
}

i have not placed my books_view.php code bcos you can see in my controller code i have done print_R($sri); i can see the the values are posted from view page to controller page …out put is

Array ( 
    [Id] => 4 
    [title] => just testng 
    [text] => goooo 
    [submit] => submit 
    ) 

` iam also getting error message

Message: Undefined property: CI_Loader::$books_model

Filename: controllers/books_Controller.php
books_controller.php i know its an issue with my model code

function books_model()
{
    parent::__Construct();
}

function post_books()
{
    $this->load->database();
    $id=$this->input->post('id');
    $title=$this->input->post('title');
    $text=$this->input->post('text');

    $data=array('id'=>$id,'title'=>$title,'text'=>$text);
    $this->db->insert('data',$data);
}

Can you guys help me to find where am I doing the mistake ?

  • 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-16T12:38:11+00:00Added an answer on June 16, 2026 at 12:38 pm
    $bookme=$this->load->books_model->post_books(); 
    

    You have already loaded the model, so now you just need to access the instance so it should be:

    $bookme=$this->books_model->post_books(); 
    

    You also need to do this:

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

    However, it should not really be the thing causing the error as it should work either way, but the above is the correct way.

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

Sidebar

Related Questions

i want to show pagination information in my page. like this Below table is
i have problem in login form $this->Auth->login() always returns false. i am using different
I'm using emebr-1.0.pre.js Having doubt in each helper context, below the following code for
I want to write a XML file as below: <?xml version=1.0 encoding=UTF-8?> <books xmlns:xsd=http://www.w3.org/2001/XMLSchema
I have two tables names book_list and book_category . Schema is like below: book_list
Below is a code snippet from a book. Why can serialNumber still be set
The below Note seems to be ambiguous to me[found in a book of C++].
The code below works great. I have a MySQL database that contains book titles
I'm reading a book about SQL. In that book, I saw strange query below:
I have an xml file likes below. <?xml version=1.0 encoding=utf-8 ?> <Book> <Title>Title</Title> <Content>Content</Content>

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.