I need to divided all data into 4 columns. i have used this method but its not coming column property
$stmt1 = $db->prepare($sql1);
$stmt5 = $db->prepare($sql1);
$stmt5->execute();
$rowcount = $stmt5->rowCount();
$pages = ceil($rowcount / 4);
$tempcount = 1;
if ($stmt1->execute(array())) {
while ($row = $stmt1->fetch()) {
?>
<?php if ($tempcount == $pages) { ?>
<div class="column">
<div class="ui bulleted list">
<?php } ?>
<a href="" class="item"> </a>
<?php
if ($tempcount == $pages) {
$pages = $pages + $pages; ?>
</div>
</div>
<?php }
$tempcount++;
}
} ?>
how i can get this columns after getting count of data i have and add those divs in between.
for an Example 20 data rows 20/4 = 5 after each 5 data, i need start and end to be added
<div class="column">
<div class="ui bulleted list">
<a href="" class="item"> </a>
<a href="" class="item"> </a>
<a href="" class="item"> </a>
<a href="" class="item"> </a>
<a href="" class="item"> </a>
</div>
</div>
<div class="column">
<div class="ui bulleted list">
<a href="" class="item"> </a>
<a href="" class="item"> </a>
<a href="" class="item"> </a>
<a href="" class="item"> </a>
<a href="" class="item"> </a>
</div>
</div>
// And so on
result will be like this
thank you very much