Creating Columns on MySQL select...
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.
Kurtis
Greg K posted this at 18:58 — 15th October 2005.
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
kazimmerman posted this at 19:23 — 15th October 2005.
He has: 698 posts
Joined: Jul 2005
Thanks. I'll try that later.
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.