[FX.php List] Split results into two columns

Stephe Pocock zippyaus at yahoo.com
Thu Aug 27 02:58:30 MDT 2009


Hi all

I have a confession to make.  I use this code alot, but I don't actually understand how it works.

http://pastebin.com/m7cb20894 

<?php
$i=0;
$half = (int) ($catResult['foundCount']/2 + 0.5);

foreach ($catResult['data'] as $key => $catData)
{
if($i == $half && $i > 10)
{
?>
            </table>
      <td valign="top">
            <table border="1">
<?php
}

?>    
    <tr> 
        <td>
            <img src="<?php echo $catData['PhotoURL'][0];?>" width="120"></td>
        <td><?php echo $catData['Full Name'][0];?><br>
        <?php echo $catData['UserName'][0];?><br>
        <?php echo $catData['Export Title'][0];?><br>
        <?php echo $catData['Level Number'][0];?> <?php echo $catData['Calc Group Short'][0];?>
        </td>
              
    </tr>
<?php
$i++;
}
}
?>



The result is half the found set is in one table row that the other half in another.

This works well in most situations, but I have a photobook where I want two columns but I would like the odd records in the left and the even records in the right so that the photo book flows with all the A's then all the B's etc

Does this make sense?  Is what I want possible?

Thanks in advance

Stephen



      __________________________________________________________________________________
Find local businesses and services in your area with Yahoo!7 Local.
Get started: http://local.yahoo.com.au
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20090827/3689d91a/attachment.html


More information about the FX.php_List mailing list