Creating Columns on MySQL select...

He has: 698 posts

Joined: Jul 2005

I am setting up the browse portion of WWWArt, and I have everything finished, except for on a page like this, where all creations in that certain category are being displayed. I only want five to display per row. How would I set it so that on every fifth one it would have a '', but not on all the others?

(Also, please realize that this is not finished yet, so the database is nearly emptied and it's not the best-looking thing yet)

Thanks ahead of time. Smiling

Kurtis

Greg K's picture

He has: 2,145 posts

Joined: Nov 2003

somethig like the following would work (here I just used a for loop)

echo "<table><tr>\n";
$lines = 0;
for ($t=0;$t<26;$t++)
{
   if ($lines % 5 == 0) echo "</tr><tr>\n";
   echo "<td>$t</td><td>$lines</td>\n";
   $lines++;
}
echo "</tr></table>\n";
'

-Greg

He has: 698 posts

Joined: Jul 2005

Thanks. I'll try that later. Laughing out loud

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.