Is it possible to add a break tag after every record, but not the last record?
Here’s my partial code:
if($db->num_rows($query) > 0)
{
while($listing = $db->fetch_array($query))
{
eval("\$page .= \"".$templates->get("page_template")."\";");
}
}
Kind regards.
First of all: please don’t use eval, there’s no benefit to it in this situation and it poses a huge security risk. Second: the theory of “every item but the last” isn’t that hard, as you’ve already got the total number. Something like this may work:
As an alternative (and a cleaner solution), you might want to implode an array of content: