Page 1 of 1

Trying to get property of non object: preg_match = what?

Posted: Thu Jan 23, 2014 7:14 am
by simonmlewis

Code: Select all

if (preg_match("/dressing/i", "$rowp->title")) 
I have this code.
And this warning for it:
[text]Notice: Trying to get property of non-object in [/text]
Is it flagging it up because "dressing" hasn't been found? Because there about 8 of these preg_matches and the rest are fine.

Re: Trying to get property of non object: preg_match = what?

Posted: Thu Jan 23, 2014 8:19 am
by Celauran
No, it's complaining that $rowp isn't an object

Re: Trying to get property of non object: preg_match = what?

Posted: Thu Jan 23, 2014 10:46 am
by simonmlewis
Thanks - I found it.
I was using the same $rowp for something else within the code.