I get the error Trying to get property of non-object in cap36.php on line 43

0

Line 43 of that php is:

<tr>
<td>Área</td>
<td><h3><?echo utf8_encode($capitulos->area); ?></h3></td>
</tr>       

I'm using php 5.6

    
asked by Jorge Kuper 14.11.2018 в 13:45
source

1 answer

1

What that error is telling you is that $capitulos is not an object.

You can use a var_dump() or print_r() to check if $capitulos is an object or not and if it is, what are its properties.

<?php var_dump($capitulos) ?>

or

<?php print_r($capitulos) ?>

On the other hand, semantically $ chapters suggest me many chapters, it may be an array of objects and that's why I'm throwing that error at you. Anyway, with both functions that I mentioned, you can see if it is an array, an object (which I already say no), an array of objects, an object of arrays ... (There are many possible combinations)

    
answered by 14.11.2018 в 13:56