views:

24

answers:

1
+1  A: 

This should to it

<div id="content">
<?php $i = 0; ?>
<?php foreach ($records as $row){?>
  <div class="item <?php echo ($i % 5) ? '' : 'nomargin';?>">
   <p class="num"><?php echo $row->id;?></p>
    <h2><?php echo $row->title;?></h2>
    <p><?php echo $row->type;?></p>   
    <p><?php echo $row->brief;?></p>
   <?php $i++ ?>
  </div>

I hope this helps.

DRL
Thanks alot, this method worked well, but I set $i = 1 and also change it to: <?php echo ($i % 5) ? '' : ' nomargin';?>">Now it works perfectly! Thanks
Greg
How about a vote up then and marking the answer correct? :)
DRL