[eluser]Sinclair[/eluser]
Hi,
I have a database query that sometimes don't return any data. I have some problems with that... shows me an error only when the query returns nothing.
Code:
A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: views/anun_view.php
Line Number: 47
I have the same error also in line 49.
This error is generated in this situation:
Code:
(line 47) <?php if ($EstadoAnuncioPago->id_anuncio_estado == 'act') : // ?>
<?php echo $row->telefone_anuncio; ?>
(line 49) <?php elseif ($EstadoAnuncioPago->id_anuncio_estado == 'stoputiliz') : // ?>
Indisponivel
<?php else : ?>
<?php echo $row->telefone_anuncio; ?>
<?php print_r($EstadoAnuncioPago); ?>
<?php endif; ?>
The print_r($EstadoAnuncioPago) returns this:
Quote:Array ( )
How can I avoid this PHP error in the IF statements?
Best Regards,