i am using bootstrap framework for college project
i have data 50+
<div class="span12">
<div class="span4">
--- data ---
</div>
<div class="span4">
--- data ---
</div>
<div class="span4">
--- data ---
</div>
</div>
i want that every row only 3 data. after three data it will create new row ie new
<div class="span12">
i am not able to do it dynamically plz help.
i tried this but didnt worked
if(mysql_num_rows($country)>0)
{
while($row=mysql_fetch_array($country))
{
$c=0;
echo "<div class='span12'>";
if($c==0 || $c==1 || $c==2)
{
echo "<div class='span4'>".$row['countryName']."</div>";
$c++;
}
else
{
echo "</div>";
}
}
}
You are setting $c back to 0 everytime. Try my below code: