CodeIgniter: Can't load database from within a model

后端 未结 2 542
花落未央
花落未央 2021-01-22 02:50

I\'ve written a new model for my CodeIgniter framework. I\'m trying to load the database from within the constructor function, but I\'m getting the following error:



        
2条回答
  •  醉话见心
    2021-01-22 03:13

    You're forgetting to call the parent constructor first. Something like:

    load->database();
    
    }
    ?>
    

提交回复
热议问题