yarub Posted September 27, 2006 Share Posted September 27, 2006 I'm trying to make it so that if I pull thirty rows from a database, they they go into three columns. However, I want them to begin a new row after they go through a column. I'm really bad at explaining stuff. Let's pretend I have thirty rows with incrementive numbers from one to thirty. I want it to do this when it pulls from the database:01 02 0304 05 0607 08 0910 11 1213 14 1516 17 1819 20 2122 23 2425 26 2728 29 30Does that make sense? I want a maximum of three columns. The more rows there are in the database, the more rows that would need to be made in the output. Can anyone direct me in the right way? Quote Link to comment Share on other sites More sharing options...
fenway Posted September 28, 2006 Share Posted September 28, 2006 This is a layout issue... deal with it in PHP. Quote Link to comment Share on other sites More sharing options...
yarub Posted September 28, 2006 Author Share Posted September 28, 2006 I don't understand why it'd be a layout issue. It would require queries, would it not?I'm not looking for just the cosmetics part of it. I want to know how to do it all. The query and all. Quote Link to comment Share on other sites More sharing options...
fenway Posted September 28, 2006 Share Posted September 28, 2006 Because having 3 columns is layout... write a query that retrieves them all, and start a new row after every 3rd value. Quote Link to comment Share on other sites More sharing options...
yarub Posted September 28, 2006 Author Share Posted September 28, 2006 I have no idea how to do that. >_> The only way I know how to do that would look like:1 1 12 2 23 3 34 4 4.. and so on. =( Quote Link to comment Share on other sites More sharing options...
fenway Posted September 29, 2006 Share Posted September 29, 2006 Just keep a count as you iterate though the results... if you're not sure how to do this, create a new thread in the PHP forum. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.