1
I’m having a problem displaying my mailing list, is giving this error:
Warning: Invalid argument supplied for foreach() in /###/###/###/view/list.php on line 11
In the file it’s like this:
<div class="container marketing">
<?php foreach ($listaRecados as $r): ?>
<div class="row featurette">
<div class="col-md-12">
<h2 class="featurette-heading"><?php echo $r->titulo; ?></span></h2>
<p class="lead"><?php echo $r->texto; ?></p>
<a href="recado.php?action=excluir&id=<?php echo $r->id; ?>"><span class="glyphicon glyphicon-trash"></span></a>
<a href="recado.php?action=curtir&id=<?php echo $r->id; ?>"><span class="glyphicon glyphicon-thumbs-up"></span></a> <?php echo $r->likes; ?> - <?php echo $r->autor; ?>
</div>
</div>
<hr class="featurette-divider">
<?php endforeach ?>
The line 12 is this: <?php foreach ($listaRecados as $r): ?>
$listaRecado
is not an array, check its value.– rray
places a print_r($listResults); and notes the return, as the comment above $listResults is not an array
– Victor Pereira
Actually he’s pulling the $listRequired from the.php message, I’m pretty beginner.
– Everton Gouveia