loading model result error |
[eluser]roothacker[/eluser]
hi i m new to codeigniter and I just start playing it i have downloaded version 2.0 and only set config.php,database.php,autoload.php for database settings and loading database library. Then I have created a controller name site.php and then created a model "site_model.php" inside this file declare a class as follows Code: <php now inside my controller "site.php" I have following code Code: <?php Now as i open site in browser giving me following error Code: db->get('test', 10); return $query->result(); } } ?>
[eluser]mariuskmc[/eluser]
sorry .... wrong answer ... but I could not delete update post
[eluser]roothacker[/eluser]
[quote author="mariuskmc" date="1298133009"]In controler mast have Code: function __construct() still not working Code: <?php
[eluser]roothacker[/eluser]
i also want to post all of my code is it allowed?
[eluser]mariuskmc[/eluser]
Code: function getAll() {
[eluser]roothacker[/eluser]
I have uploaded my source code at http://www.box.net/shared/xnejcl0oxo Please download and find out whats wrong in it.
[eluser]mariuskmc[/eluser]
in model you start with <php class Site_model extends CI_Model { must have <?php najam is great
[eluser]roothacker[/eluser]
[quote author="mariuskmc" date="1298137014"] Code: function getAll() { I think error was related to some loader class that cant load my model Fatal error: Class 'Site_model' not found in D:\wamp\www\ci\system\core\Loader.php on line 198
|
Welcome Guest, Not a member yet? Register Sign In |