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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:02:13+00:00 2026-05-28T14:02:13+00:00

I recently upgraded to CodeIgniter 2.1. The below model code (machforms_model.php) was properly working

  • 0

I recently upgraded to CodeIgniter 2.1. The below model code (machforms_model.php) was properly working in my previous CI install. I have also confirmed that my database.php file is identical to the previous install, so db configuration should not be the source of my problem. The error message I see now is: Fatal error: Call to a member function query() on a non-object in models/machforms_model.php on line 24, where line 24 is my first query attempt.

machforms_model:php
class machforms_model extends CI_Model 
{

    public function __construct() {
        parent::__construct();
        $CI =& get_instance();
        $CI->machformsdb = $this->load->database('machforms', TRUE);
        $this->machformsdb = $CI->machformsdb; 
    }


        function deauthorize_user($user_guid) {
        $sql = 'delete from ap_sessions where user_guid=?';
        $sql_result = $machformsdb->query($sql,array($user_guid));   // LINE 24     
    }
}

I am uncertain why I receive the overload error. If other external file/config information may be the culprit, please advise and I will post accordingly.

  • 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-28T14:02:14+00:00Added an answer on May 28, 2026 at 2:02 pm

    $machformsdb is not defined in your function deauthorize_user. You should call $this->machformsdb.

    In addition: in your constructor, $this is already an instance of CI_Model so you don’t need to get the CodeIgniter singleton instance. You could just write:

    public function __construct() {
      parent::__construct();  
      $this->machformsdb = $this->load->database('machforms', TRUE);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently upgraded to Flash Builder 4.5 for PHP since I’m working on a
I recently upgraded to Subversion 1.5, and now I cannot commit my code to
I recently upgraded VS 2005 to VS 2008. Unfortunately I have a very basic
I recently upgraded a C# project from .NET 3.5 to .NET 4. I have
I recently upgraded to PHP 5.3 and since then I get (sporadic) error messages
I recently upgraded a 1.3.6 application to Grails2. My test cases have started failing
I recently upgraded my SharePoint development machine to VSeWSS 1.3 and have noticed a
I recently upgraded my main computer and am now working in windows Vista. My
I recently upgraded to Ubuntu 9.04 and I have issues using gems. I installed
We recently upgraded the code to gcc4.3.3 from gcc4.2.4 . void testAndSet( volatile int*

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.