• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Undefined property: Cpages::$mpages

#1
Hello,

Can you help me fix this problem:

--->  Undefined property: Cpages::$mpages


controllers/cpages.php


PHP Code:
public function addparentctgcreate() {
        
        
        
        
$this->form_validation->set_rules('ctgname''Category Name''required');
        
$this->form_validation->set_rules('ctgdescription''Category Description''required');
        
        if(
$this->form_validation->run() === FALSE)
        {
            
$this->load->view('cpages/addparentctgcreate');
        }
        else
        {
            
$this->mpages->set_parentctg();
            
$this->load->view('cpages/addparentctgsuccess');
        }    
        
    } 



models/mpages.php

PHP Code:
    public function set_parentctg()
    {
    
 
       $data = array(
        
'ctgname' => $this->input->post('parent_name');
        
'ctgdescription' => $this->input->post('description'));

    
    return 
$this->db->insert('menu'$data);    
    
    } 




A PHP Error was encountered
Severity: Notice
Message: Undefined property: Cpages::$mpages
Filename: controllers/cpages.php
Line Number: 53
Backtrace:
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyGiondaCI\application\controllers\cpages.php
Line: 53
Function: _error_handler
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyGiondaCI\index.php
Line: 315
Function: require_once


Line 53:              $this->mpages->set_parentctg();
" If I looks more intelligence please increase my reputation."
Reply

#2
$this->load->model('mpages')
Keep calm.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.