Showing myswl results in rows?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Mr Tech
Forum Contributor
Posts: 424
Joined: Tue Aug 10, 2004 3:08 am

Showing myswl results in rows?

Post by Mr Tech »

Lets say I have 10 results in a mysql database... How do I get it to show 4 results per row...

E.g:

Row 1 | Row 2 | Row 3 | Row 4
Row 5 | Row 6 | Row 7 | Row 8
Row 9 | Row 10

How do I do this?
Ben
User avatar
harrisonad
Forum Contributor
Posts: 288
Joined: Fri Oct 15, 2004 4:58 am
Location: Philippines
Contact:

Post by harrisonad »

I answered this on old thread
viewtopic.php?t=35254
his problem is to display 3 data in every row, similar to yours.
neugent
Forum Newbie
Posts: 24
Joined: Wed Jul 06, 2005 3:35 am
Location: Philippines

Post by neugent »

i have asked this question already and had mine running and revised a few times, here is the link.

http://forums.devnetwork.net/viewtopic.php?t=35254

enjoy. :D
neugent
Forum Newbie
Posts: 24
Joined: Wed Jul 06, 2005 3:35 am
Location: Philippines

Post by neugent »

hehe...ey harrisonad, i was just 2 minutes behind your post :p hehehehe
User avatar
Mr Tech
Forum Contributor
Posts: 424
Joined: Tue Aug 10, 2004 3:08 am

Post by Mr Tech »

Awesome! Thanks guys!
User avatar
harrisonad
Forum Contributor
Posts: 288
Joined: Fri Oct 15, 2004 4:58 am
Location: Philippines
Contact:

Post by harrisonad »

[language='philippines']lang hiya ka! pareho pa tayo ng link :lol:[/language]
neugent
Forum Newbie
Posts: 24
Joined: Wed Jul 06, 2005 3:35 am
Location: Philippines

Post by neugent »

in case you forgot, twas my post, and you were the one who answerd it before :lol:
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

solve your problem that will, however do as JCart suggested and use mod I would...

Code: Select all

if($numberofcolumn % $maxnumberyouwantperrow == 0)
   echo "<tr>";
   //etc...
Post Reply