[FX.php List] Split results into two columns

Gjermund Gusland Thorsen ggt667 at gmail.com
Thu Aug 27 04:05:13 MDT 2009


I did an effort into making it readable, at least to myself:
http://pastebin.com/f7981902e

And it seems you lack an initial { or I left something out

ggt

2009/8/27 Stephe Pocock <zippyaus at yahoo.com>:
> 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
>
> start: 0000-00-00 end: 0000-00-00
> ________________________________
> Find local businesses and services in your area with Yahoo!7 Local. Get
> started.
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>
>


More information about the FX.php_List mailing list