How can I export values from a database and echo all it separated by an <hr />, except the first and the last results??
$stmt = $db->prepare("SELECT `title`, `content` FROM `news` ORDER BY title ASC");
$stmt->execute(array($category));
foreach($stmt as $row){
echo "<p>" . $row['title'];
echo $row['content'] . "</p> <hr />";
}
it outputs:
<p>title1
content1</p>
<hr>
<p>blabla
blabla</p>
<!--My question is how to remove this hr-->
<hr>
I tried to use a for cicle, but it didn't work.
thanks in advance