trouble shooting |
[eluser]subhashramesh[/eluser]
Hi all, I write one simple datbase access application to retive data using CI framework,but i am getting error as Fatal error: Call to a member function _assign_libraries() on a non-object in C:\xampp\htdocs\CodeIgniter_1.7.1\system\libraries\Loader.php on line 1038 could you please help to fix above error.
[eluser]LuckyFella73[/eluser]
Please post the code of your controller otherwise even the CI nurds can't help you with you problem.
[eluser]subhashramesh[/eluser]
thanks for your reply.I am giving my model,controler,view functions.could you please fix coming error. my model is <?php class AccessDatabase_model extends Model { function AccessDatabase_model() { parent::Model(); } function getData() { $query = $this->db->get('sample'); if ($query->num_rows() < 0) { show_error('Database is empty!'); } else{ return $query->result(); } } } ?> my controler is <?php class AccessDatabase extends Controller{ function AccessDatabase() { parent::Controller(); } function index() { $this->load->model('AccessDatabase_model'); $data['result'] = $this->AccessDatabse_model->getData(); $data['page_title'] = "CI Hello World App!"; $this->load->view('AccessDatabase_view',$data); } } ?> my view is <html> <head> <title><?=$page_title?></title> </head> <body> <?php foreach($result as $row):?> <h3><?=$row->a?></h3> <p><?=$row->b?></p> <p><?=$row->c?></p> <br /> <?php endforeach;?> </body> </html> i tried to use this url:https://localhost/CodeIgniter_1.7.1/index.php/AccessDatabase I am getting error as A PHP Error was encountered Severity: Notice Message: Undefined property: AccessDatabase::$Ok1 Filename: libraries/Loader.php Line Number: 1038 Fatal error: Call to a member function _assign_libraries() on a non-object in C:\xampp\htdocs\CodeIgniter_1.7.1\system\libraries\Loader.php on line 1038
[eluser]LuckyFella73[/eluser]
I didn'd have a look at your model and view file but your controller should more look like that: Code: <?php Please use the "code" tags when posting - it makes your code more readable.
[eluser]LuckyFella73[/eluser]
Maybe your model should look like: Code: <?php
[eluser]subhashramesh[/eluser]
Thanks for your reply,i changed controler file as suggetsted by you.But still i am getting same error.may i know what's code taggs,how its helpful to increase redablity? could you please solve error in any other way?
[eluser]LuckyFella73[/eluser]
[quote author="subhashramesh" date="1251724262"]may i know what's code taggs,how its helpful to increase redablity? could you please solve error in any other way?[/quote] When you post code here you click at the "code" button on top of the editor. Then you get a opening an a closing code tag where you paste your code in between. Then your code looks like my code examples. Did you check my model-code?
[eluser]subhashramesh[/eluser]
Hi, thanks for dedicating time to reply my quries.still i am unable to get by placing model as tell by you.kindly look through it.
[eluser]n0xie[/eluser]
Quote:Class names must have the first letter capitalized with the rest of the name lowercase. Make sure your class extends the base Model class. http://ellislab.com/codeigniter/user-gui...odels.html
[eluser]narendran[/eluser]
hi, I’m doing Cart system like products,category,order etc.for this i have to write code for admin area to edit,delete,add,giving authorization to customers to login or not. frnds, I’m Beginner of CI.so help me how to do this by CI.give me reference sites.sample codes also. hope i will get a Good response from u. thanks, Narendran |
Welcome Guest, Not a member yet? Register Sign In |