I am trying to print results from a mysql query in a table that will be in 2 columns. to do this through my for loop i did the following:
$num = 1;
while($r = $qry->fetch())
{
if (!fmod($num,2)) echo '<tr>';
echo "<td>" . $num . "</td>";
if (!fmod($num,2)) echo '</tr>';
$num++;
}
however, each row is getting its own row in the table. even though $num is printed and shows 1,2,3,4 and so on. what am i missing?