I have the following database query:
$database = JFactory::getDBO(); $database->setQuery("SELECT items.headline, items.image, items.copy, items.source FROM ms95f_createalist_items items JOIN ms95f_createalist_categories categories ON items.heading = " . $this->item->id); $orderitems = $database->loadObjectList(); I call this in html using:
<div class="feedList"> <?php $count = 0; foreach ($orderitems as $item) { ?> <div class="feedItem"> <div class="number"> <?php echo $count; ?></div> <div class="headline"> <?php echo $item->headline; ?></div> <div class="image"> <?php echo $item->image; ?></div> <div class="copy"> <?php echo $item->copy; ?></div> <div class="source"> <?php echo $item->source; ?></div> </div> <?php $count++; } ?> </div> It's working great, but I'm getting the output of each item twice. Any ideas where I'm going wrong?
#__instead of manually defining it (ms95f_)