1

I'm getting the following error reports:

Severity: Notice
Message:
Trying to get property of non-object

Using gettype() I can see that it's a proper object.

A print_r() returns:

stdClass Object ( [campaigngroupid] => 3 [name] => And another one [dt_created] => 2014-02-04 17:11:21 [created_userid] => 1 [deleted] => 0 )

Echoing out $object->name for example works fine, but still, I'm getting this notice...

The object is set using CodeIgniter's ->row() from a database query result.

All I can ask is, sup?

1
  • can you add your model code? Commented Feb 5, 2014 at 14:28

1 Answer 1

1

Try this in your model, Suppose $query holds the query object:

 function some_model_function(){
     ..........
     ..........
     if($query->num_rows() > 0 ){
        return $query->row();
     }
     return FALSE;
 }

Also check whether the notice is from any where else.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.