Web Hosting Talk







View Full Version : MySQL Select Query returning results in...


seodevhead
10-21-2005, 07:33 PM
I'm using php and mysql and I have a 3 column table I want to return a set of results into. The thing is... I want the data to fill up the first column (fixed table height), and if column 1 fills up, it will start adding the data to column 2 and so on. Any idea how this can be achieved? Thanks.

Dan Grossman
10-22-2005, 01:21 AM
Throw a little math into your loop through the result set. Use mysql_num_rows() to get the number of rows returned from the query, divide by 3, put a counter into your loop, and when it hits 1/3rd and 2/3rds start the new column in the table.