i\'m pretty new to this and not sure how should i do it,
I\'ve got a database with a column called \"names\"
how can i make it display in so?
You know accomplish this by assigning the row count before you start the variable and few flags to know initialized loop or started/ended loop.
$i = 1;
$initFlag = false;
$flag = "closed";
while($row = mysql_fetch_array($result)) {
if($i%3 == 0) $initFlag = false;
if($flag == "closed" && ($i == 1 || $i % 3 == 1)) {
echo ""; $flag = "started"; $initFlag = true;
}
echo ''.$row['names'].' ';
if(!initFlag && $flag == "started" && $i % 3 ==0) {
echo " "; $flag = "closed";
}
$i++;
}