View Single Post
Old 01-21-2013, 05:59 PM   PM User | #5
SB65
Senior Coder

 
Join Date: Feb 2009
Location: West Yorkshire
Posts: 2,812
Thanks: 9
Thanked 681 Times in 675 Posts
SB65 will become famous soon enoughSB65 will become famous soon enough
Something like:

PHP Code:
$result mysql_query($query);
$count=0;//initialise a variable to count the results
while ($item mysql_fetch_array($result))
   {
   
$count++;//increment the counter each time
   
if ($count 2$left .= <div class="item">.$item['author'].$item['quote']</div>; //if not exactly divisble by 2 must be odd, so left column
   //wrap author and quote in other tags as required....
   
else $right .= <div class="item">.$item['author'].$item['quote']</div>; //otherwise even, so right column
   

would work.
__________________
Use the W3C HTML Validator and CSS Validator to check your code and Firebug to see what css is applied to an element
Read Steve Krug's book Don't Make Me Think - essential reading on web usability
I don't recommend much, but I do recommend Clook for UK web hosting

Last edited by SB65; 01-21-2013 at 06:08 PM..
SB65 is offline   Reply With Quote
Users who have thanked SB65 for this post:
alexkrolla (01-22-2013)