In the CMS i’m working on I’m using a foreach statement to display the returned database results.
but ever page load I get an error message saying the foreach statement im using has an invalid argument
here’s the statement
<?php foreach ( $presults as $post ) { ?>
<!-- Post Frames -->
<div class="outerPost_frame">
<div class="postScreen">
<!--post date hidden show on hover -->
<span class="date_">
<p><?php echo date('j F', $post->date) ?></p>
</span>
<!-- post title -->
<span class="name_">
<p><?php echo htmlspecialchars($post->name) ?></p>
</span>
<span class="content_">
<?php echo $results['post']->content ?>
</span>
</div>
</div>
<?php } ?>
Try casting $presults to an array.