Teach me how to program |
02-14-2016, 12:05 AM
(This post was last modified: 02-20-2016, 07:41 AM by ciadmin. Edit Reason: add more info )
A PHP Error was encountered
Severity: Notice Message: Undefined property: Home::$page_model Filename: controllers/home.php Line Number: 14 Backtrace: File: C:\xampp\htdocs\ci3\application\controllers\home.php Line: 14 Function: _error_handler File: C:\xampp\htdocs\ci3\index.php Line: 292 Function: require_once An uncaught Exception was encountered Type: Error Message: Call to a member function find_ID() on null Filename: C:\xampp\htdocs\ci3\application\controllers\home.php Line Number: 14 Backtrace: File: C:\xampp\htdocs\ci3\index.php Line: 292 Function: require_once How to fix those error? home.php PHP Code: $this->data['page_detail'] = $this->page_model->find_ID(); ci3/index.php PHP Code: require_once BASEPATH.'core/CodeIgniter.php'; Why the error appears? models/page_model.php PHP Code: public function find_ID($post_ID = false)
" If I looks more intelligence please increase my reputation."
Are you loading the page model?
$this->load->model('page_model')
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
Okay, here I have a new error that I am dealing with:
A PHP Error was encountered Severity: Notice Message: Undefined property: Home::$db Filename: core/Model.php Line Number: 77 Backtrace: File: C:\xampp\htdocs\ci3\application\models\page_model.php Line: 80 Function: __get File: C:\xampp\htdocs\ci3\application\controllers\home.php Line: 15 Function: find_ID File: C:\xampp\htdocs\ci3\index.php Line: 292 Function: require_once ----------------------------------------- An uncaught Exception was encountered Type: Error Message: Call to a member function select() on null Filename: C:\xampp\htdocs\ci3\application\models\page_model.php Line Number: 80 Backtrace: File: C:\xampp\htdocs\ci3\application\controllers\home.php Line: 15 Function: find_ID File: C:\xampp\htdocs\ci3\index.php Line: 292 Function: require_once -------------------------------- page_model.php PHP Code: public function find_ID($post_ID = false) line 80: $this->db->select('post.*, template.*'); controllers/home.php PHP Code: public function index() line 15: $this->data['page_detail'] = $this->page_model->find_ID(); index.php PHP Code: require_once BASEPATH.'core/CodeIgniter.php'; Can you help me fix the error?
" If I looks more intelligence please increase my reputation."
You should connect to the database http://www.codeigniter.com/user_guide/da...r-database
How do I know if my CI already connected to the database or not?
database.php PHP Code: $db['default'] = array( oh well ... sorry.. I am considering myself a beginner in CI. I need some help from experts. Thanks in advance.
" If I looks more intelligence please increase my reputation."
A PHP Error was encountered
Severity: Notice Message: Undefined property: Home::$db Filename: core/Model.php Line Number: 77 ------------------------- core/Model.php PHP Code: public function __get($key) line 77: return get_instance()->$key;
" If I looks more intelligence please increase my reputation."
I think you need make sure you are loading the DB library.
I would recommend you reading through all the CI documentation first. It's extremely well written, easy to follow, and will probably prevent the next few posts you were going to make. If you follow the guide, you will be able to connect to the db, execute a sql query and parse the results.
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
i have so much sympathy for people who try and build first without doing the tutorial because thats how i was.
but seriously -- do the tutorial. and don't just paste the code and get it working but really step through and learn each step. you will save yourself so much time.
well all you need copy paste your error in google, you need to autoload database just goes to your config/autoload.php then add database, look at me here
Code: $autoload['libraries'] = array('database'); //you need to autoload it ! |
Welcome Guest, Not a member yet? Register Sign In |