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

Michele Wandrei michele at inthree.com
Fri Sep 28 16:22:13 CDT 2001


> I'll expand a bit on Michael's code to fit your needs

<snip>
>      for ($i=1; $i<=$num_rows; $i++) {
>   $newData[]=mysql_fetch_array($result);
> echo "<td>".$newData[0]."</td>\n";
> if(($i % 3) == 0) {
> echo "</tr>\n<tr>\n";

Thanks Michael, Jeremy, and Joshua.

I think that's basically what I'm looking for.  It was easy
enough to loop through the query using "LIMIT $offset, 3"  (where
$offset was incremented by 3 each time it looped through).  I
just wasn't quite sure how to approach the same thing by looping
through the array.  I haven't had the opportunity to try this out
yet, but it looks like it will work.

Thanks again!  What a wonderful way to learn.

___________________________________________________
Michele Wandrei
inThree Design
www.inthree.com










More information about the thelist mailing list