[eluser]boltsabre[/eluser]
You've got a shorthand foreach loop in there that you forgot to close and you've got your "no records" inside your if statement, you want something like this ;-)
Code:
<?php if(isset($records)) : foreach($records as $row) : ?>
<h2><?php echo $row->title; ?></h2>
<div><?php echo $row->content; ?></div>
<h2>No records were returned.</h2>
<?php endif; ?>
Should be:
<?php if(isset($records)) :?>
<?phpforeach($records as $row) : ?>
<h2><?php echo $row->title; ?></h2>
<div><?php echo $row->content; ?></div>
<?php endforeach; ?>
<?php else:?>
<h2>No records were returned.</h2>
<?php endif; ?>