I'm trying to echo 3 places in a stored database, break them with a html divider and then echo a further 3 places followed by a html divider and so on. At the moment the code I have just prints one place followed by the divider. Is there an easy way of doing this?
<?
include_once "connect_to_mysql.php";
$sql = mysql_query("SELECT `p_id`, `pname`, `address`, `country`, `type` FROM places WHERE category='ecodo'");
$count = mysql_num_rows($sql);
while($row = mysql_fetch_array($sql)){
$p_id = $row["p_id"];
$pname = $row["pname"];
$address = $row["address"];
$country = $row["country"];
$type = $row["type"];
echo '
<div class="col-md-3 col-sm-6 md-margin-bottom-40">
<div class="easy-block-v2">
<img alt="" src="placeFiles/'.$p_id.'/pic1.jpg">
<h3>'.$pname.'</h3>
<ul class="list-unstyled">
<li><span class="color-green">Type: </span>'.$type.'</li>
<li><span class="color-green">Address: </span>'.$address.'</li>
<li><span class="color-green">Country:</span>'.$country.'</li>
</ul>
<a class="btn-u btn-u-sm" href="place_profile.php?p_id='.$p_id.'">See More</a>
</div>
</div>
<!-- Divider -->
<div class="clearfix margin-bottom-20"><hr></div>
<!-- Easy Blocks v2 -->
<div class="row">';
}
?>