• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fatal error on model

#1
[eluser]JasmineFlower[/eluser]
Hi,

I am using codeigniter 2.0.1.
I got an error on my model.

Code:
<?php  (defined('BASEPATH')) OR exit('No direct script access allowed');

class Register_model extends CI_Model
{    
    function Register_model()
        {
                parent::CI_Model();
        }
    public function individual_user_registration($table_name)
    {
        $this->db->select($table_name);
    }
        
}
?>


error: Fatal error: Call to undefined method CI_Model::CI_Model() in C:\xampp\htdocs\icadnxgen\icad_app\models\register_model.php on line 7

how to solve this problem?

#2
[eluser]John_Betong_002[/eluser]
 
http://ellislab.com/codeigniter/user-gui...odels.html
 
 

#3
[eluser]InsiteFX[/eluser]
If you read the CodeIgniter User Guide you would have known this!
Code:
<?php  (defined('BASEPATH')) OR exit('No direct script access allowed');

class Register_model extends CI_Model
{    
    function __construct()
        {
                parent::__construct();
        }
    public function individual_user_registration($table_name)
    {
        $this->db->select($table_name);
    }
        
}
?>

InsiteFX

#4
[eluser]JasmineFlower[/eluser]
Hi,

I defined construct method,Its working now.Thank u


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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