[thelist] PHP/MySQL results in multiple table cells?

Joshua Olson joshua at alphashop.net
Fri Sep 28 08:33:25 CDT 2001


Perhaps there is a way to pretend we are grabbing three rows at a time.

The trick is to grab the entire set of images and wrapping the display of
each one in it's own table cell.  Then, when the timing is just right,
through a </tr><tr> in the mix to start a new row.

Something like this pseudocode

<tr>
  loop through items
    if query.row modulus 3 IS 0 "</tr><tr>"
    "<td>"
      Insert display of item
    "</td>"
  loop
  Insert trival <td>'s to pad out the last row of the table here.
</tr>

Does this answer your question?

-joshua


----- Original Message -----
From: "Michele Wandrei" <michele at inthree.com>
Subject: [thelist] PHP/MySQL results in multiple table cells?



<snip>
: It seems like there must be an easier way to do this.  Is there a
: way to run one query, then loop through the results array three
: rows at a time?
</snip>





More information about the thelist mailing list