What is that I am doing wrong? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: What is that I am doing wrong? (/showthread.php?tid=17532) |
What is that I am doing wrong? - El Forum - 04-07-2009 [eluser]xoail[/eluser] I am getting this error: Fatal error: Call to a member function result() on a non-object in C:\wamp\www\example\system\application\views\user_view.php on line 5 my user_view file is: Code: <h1>Title</h1> and User controller: Code: class User extends Controller { and user_mode: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Thanks! What is that I am doing wrong? - El Forum - 04-07-2009 [eluser]TheFuzzy0ne[/eluser] Welcome to the CodeIgniter forums! You're getting the query_result() and not the query_array(). query_array() returns an array query_result (aka result()), returns an object. You either need to use the result like an object (echo $row->new_text), instead of an array, or get the result array. Hope that makes sense. What is that I am doing wrong? - El Forum - 04-07-2009 [eluser]xoail[/eluser] thanks for a quick reply.. heres how the code looks now... but I wont see any data.. user_view; Code: <h1>Title</h1> user controller: Code: <?php user model: Code: function UserText() What is that I am doing wrong? - El Forum - 04-07-2009 [eluser]pistolPete[/eluser] I guess the function user_model->UserText(); is not called because of your login check: Code: $loggedin['status'] = $this->redux_auth->logged_in(); It probably should be changed to something like this: Code: $loggedin = $this->redux_auth->logged_in(); What is that I am doing wrong? - El Forum - 04-07-2009 [eluser]TheFuzzy0ne[/eluser] Well spotted, Pete! I second Pete's suggestion, you're checking if loggedin is TRUE (type bool), but it's of type "array". What is that I am doing wrong? - El Forum - 04-07-2009 [eluser]xoail[/eluser] yup.. that was it.. thanks a lot guys.. |