I'm getting 3 errors (Undefined offset, trying to get property of non-objetc,... Please help - 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: I'm getting 3 errors (Undefined offset, trying to get property of non-objetc,... Please help (/showthread.php?tid=43385) |
I'm getting 3 errors (Undefined offset, trying to get property of non-objetc,... Please help - El Forum - 07-09-2011 [eluser]Aladin[/eluser] Hello, I'm trying to create a website with 3 type of membership, but when I added a code to the login function it puzzled me with 3 errors: Quote:Message: Undefined offset: 1 (line 34) This is the code: Code: function login_process($login, $pass) EDIT 1 Line 34 is Code: $avocatStatus = $result[1]->status; I'm getting 3 errors (Undefined offset, trying to get property of non-objetc,... Please help - El Forum - 07-09-2011 [eluser]tintamarre[/eluser] Hello, usually, the Message: Undefined offset: 1 (line 34) error is because the index 1 does not exist on your array. I would go in this direction... T. I'm getting 3 errors (Undefined offset, trying to get property of non-objetc,... Please help - El Forum - 07-09-2011 [eluser]Aladin[/eluser] Yes but how to fix it? I've tried Code: $avocatStatus = $result['status']->status; Please anyone can help? I'm getting 3 errors (Undefined offset, trying to get property of non-objetc,... Please help - El Forum - 07-09-2011 [eluser]tintamarre[/eluser] Did you declare your Array before ? Code: $result = Array (); I'm getting 3 errors (Undefined offset, trying to get property of non-objetc,... Please help - El Forum - 07-09-2011 [eluser]Aladin[/eluser] It's getting worse, now in addition a Message: Trying to get property of non-object is added to the list. What I want is that the script checks the status from the table then do the comparison below. Is there anything wrong with it? I'm getting 3 errors (Undefined offset, trying to get property of non-objetc,... Please help - El Forum - 07-09-2011 [eluser]John_Betong_002[/eluser] Try this: Run your browser note results and script line remove debug die(); repeat until error found. Code: function login_process($login, $pass) I'm getting 3 errors (Undefined offset, trying to get property of non-objetc,... Please help - El Forum - 07-09-2011 [eluser]jmadsen[/eluser] I think you are confusing Code: result(); with Code: row(); look at the examples from http://ellislab.com/codeigniter/user-guide/database/results.html Code: $query = $this->db->query("YOUR QUERY"); |