I'm trying to create a table that has 1, 32, or 3 columns depending on the number of records (up to 120). I want to display 40 records per column. I cam up with his code for formatting and populating the columns but it gives a syntax error. What am I doing wrong?
$columns = 3;
$num_rows = 90;
for (n=1; n <= $columns; n++) {
echo "<td>";
$i = (1 + ((n -1)*40));
while($i <= $num_rows) {
if ($num_rows <= (n*40){
echo $name[$i] . "<br>"
$i++;
}
}
echo "</td>";
}