I'm getting 3 errors (Undefined offset, trying to get property of non-objetc,... Please help |
[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;
[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.
[eluser]Aladin[/eluser]
Yes but how to fix it? I've tried Code: $avocatStatus = $result['status']->status; Please anyone can help?
[eluser]tintamarre[/eluser]
Did you declare your Array before ? Code: $result = Array ();
[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?
[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)
[eluser]jmadsen[/eluser]
I think you are confusing Code: result(); with Code: row(); look at the examples from http://ellislab.com/codeigniter/user-gui...sults.html Code: $query = $this->db->query("YOUR QUERY"); |
Welcome Guest, Not a member yet? Register Sign In |