Hi, I am trying to create a 3 column mailing label printout, with out much luck. The best I can get is a "step" print out with rec1 in row 1 col1 , rec2 in row 2 col2, rec3 in row3, col3. What I would like is: rec1 row1 col1, rec2 row1 col2, rec3 row1 col3, rec4 row2, col1 etc...... My last "ugly" version of the code is below.
Thanks!!!
<?
while ($x<$numberall)
{
// Retreiving data and putting it in local variables for each row
$firstname=mysql_result($resultall,$x,"firstname");
$lastname=mysql_result($resultall,$x,"lastname");
$line1=mysql_result($resultall,$x,"line1");
$line2=mysql_result($resultall,$x,"line2");
$city=mysql_result($resultall,$x,"city");
$state=mysql_result($resultall,$x,"state");
$zip=mysql_result($resultall,$x,"zip");
?>
<table border="1">
<tr>
<td width="200">
<p>
<? if ($x=='0' || $x=='3' || $x=='6' || $x=='9' || $x=='12' || $x=='15' || $x=='18' || $x=='21' ) { ?>
<? echo $firstname; ?> <? echo $lastname; ?><br>
<? echo $line1; ?> <br>
<?if ($line2) { echo $line2, "<br>" ; } ?>
<? echo $city; ?>, <? echo $state; ?> <? echo $zip; ?>
<? } ?>
</p>
</td>
<td width="200">
<p>
<? if ($x=='1' || $x=='4' || $x=='7' || $x=='10' || $x=='13' || $x=='16' || $x=='19' || $x=='22') { ?>
<? echo $firstname; ?> <? echo $lastname; ?><br>
<? echo $line1; ?> <br>
<?if ($line2) { echo $line2, "<br>" ; } ?>
<? echo $city; ?>, <? echo $state; ?> <? echo $zip; ?>
<? } ?>
</p>
</td>
<td width="200">
<p>
<? if ($x=='2' || $x=='5' || $x=='8' || $x=='11' || $x=='14' || $x=='17' || $x=='20' || $x=='23') { ?>
<? echo $firstname; ?> <? echo $lastname; ?><br>
<? echo $line1; ?> <br>
<?if ($line2) { echo $line2, "<br>" ; } ?>
<? echo $city; ?>, <? echo $state; ?> <? echo $zip; ?>
<? } ?>
</p>
</td>
</tr>
<?
$x++;
}} // end if numberall > 0
?>
</table>