SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict Iceman90's Avatar
    Join Date
    Mar 2006
    Location
    Calgary, Alberta, Canada
    Posts
    392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How Would I Acheive This?

    Hi everyone.

    I am looking for a way to achieve a layout like the following layout in the most efficient way possible.


    Right now, I was going to have 3 queries, one for the left column, one for the right column, and one for the bottom list. I am using a non-table based layout in CSS.

    Is there an easier way to achieve this than by doing 3 db queries?

  2. #2
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Yes, 1 query. Those are all news, right? Ordered by time, I assume. So it's just a matter of breaking it into 3 separate divs, like:
    Code php:
    $i=0;
    echo '<div id="right">';
    while($row=mysql_fetch_array($r)){
      if($i++==5)echo '</div><div id="left">';
      elseif($i==9) echo '</div><div id="bottom">';
      //...
    }
    echo '</div>';
    Saul


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •