I have a table that I am trying to layout so I can print off my active ad tracking numbers and their values.
When I do a php foreach() o the following SQL query $activeNos = DBSelectAllArrays("SELECT * FROM ".AD_TRACKING_TABLE." ");
I get the following layout:
101 102 103
104 105 106
106 108 109 thru to 356
but I would like to get following layout:
101 131 161
102 132 162
103 133 163 thru to 356
Here is the complete script and table layout I have...
<table border="1" bordercolor="#999999" cellpadding="3" cellspacing="0" width="720" style=" border-collapse: collapse">
<tr>
<td width="35" class="medfont"><b>AD</b></td>
<td class="medfont"><b>Vendor Name</b></td>
<td width="65" class="medfont"><b>Price</b></td>
<td width="35" class="medfont"><b>AD</b></td>
<td class="medfont"><b>Vendor Name</b></td>
<td width="65" class="medfont"><b>Price</b></td>
<td width="35" class="medfont"><b>AD</b></td>
<td class="medfont"><b>Vendor Name</b></td>
<td width="65" class="medfont"><b>Price</b></td>
</tr>
<?php
$col = 0;
$activeNos = DBSelectAllArrays("SELECT * FROM ".AD_TRACKING_TABLE." ");
foreach ($activeNos as $activeNos)
{
if ($col == 0)
{
?>
<tr>
<?php
}
?>
<td class="medfont"><?= $activeNos['ad_tracker'] ?></td>
<td class="medfont"><?= $activeNos['property_name'] ?></td>
<td class="medfont">$<?= FmtAmt($activeNos['asking_price']) ?></td>
<?php
if (++$col == 3)
{
$col = 0;
?>
</tr>
<?php
}
}
?>
</table>