Welcome to Sitepoint.
I suspect it is printing every record, but 'the last' record has no [title] value.
Try this, as a test:
Code:
<div class="row">
<?php
if(!empty($records)) {
foreach($records as $record) {
?>
<div class="span6">
<div align="left">
<h2><?php echo $record['title']; ?></h2><p>The $record looks like this: <?php var_dump($record); ?></p>
</div>
</div>
<?php
}
}
?>
</div>
Also, you may notice the 'literal' strings do not need to be enclosed in PHP tags and 'echo'ed.
I hope that is helpful. And the result may allow someone else to better assist you.
My PHP skills are very rusty.
Bookmarks