$price = $dbh->prepare('SELECT * FROM `price`');
$price->execute(array());
$i=0;
$str = "";
while ($p = $price->fetch(PDO::FETCH_LAZY))
{
?>
<div>
<?
$str = $str. $p['name'].' ,';
if ($i % 3 == 0)
{
echo $str;
$str = "";
}
$i++;
?>
</div>
<?php
}