![]() |
Call to a member function on a non-object - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Call to a member function on a non-object (/showthread.php?tid=13053) |
Call to a member function on a non-object - El Forum - 11-09-2008 [eluser]spagi[/eluser] Hi i have a problem Fatal error: Call to a member function on a non-object in /3w/zaridi.to/s/spagi/system/application/views/rubrika_detail.php on line 27 Code: function detail(){ Code: <?php Can anyone explain what is wrong? Call to a member function on a non-object - El Forum - 11-09-2008 [eluser]ConnorD[/eluser] I am not exactly sure, but you may want to try in your view rather than having $row = $query->row(), try $row = $query->result(). That's what I use anyway. If that doesn't work as it is, then I would suggest that you put the results into a foreach statement to loop through all the results: Code: foreach($query->result() as $row){ Call to a member function on a non-object - El Forum - 11-09-2008 [eluser]spagi[/eluser] I do not know what is wrong, but it still does not work :-S Call to a member function on a non-object - El Forum - 11-09-2008 [eluser]ConnorD[/eluser] also, make sure that you have loaded the Database library. I suppose that could be the problem... Call to a member function on a non-object - El Forum - 11-09-2008 [eluser]ray73864[/eluser] why are you loading the same view twice in the same function? also, the error that you are getting points to a problem with your sql query itself, basically it isn't returning anything so when you try to pull something out it errors out. Call to a member function on a non-object - El Forum - 11-09-2008 [eluser]lmv4321[/eluser] You are calling the view for the first time before setting $data['ut']. Try removing the view call after the line $data['diskuze']=$this->db->get('rubdisk'); |