jacko_162 Posted March 13, 2010 Share Posted March 13, 2010 i am trying to print results from a mysql query, which works and displays. what i was wondering is how i can echo my results in a table, but limit the amount of colums to 5 before starting a new line? if that makes sense.. here is my working query; <? // initiate query $results = mysql_query("SELECT * FROM tests WHERE member_id='$_SESSION[sESS_MEMBER_ID]' ORDER BY id DESC LIMIT $page, $limit"); while ($data = mysql_fetch_array($results)) { ?> <td><?=$data["day"]?></td> <? } ?> my $limit array is currently set at 20 which would be fine if i wanted to display each result in a row but as i want columns 20 columns across makes the page too wide, so i wanted to set it to show 5 colums accross, then start a new line with another 5 and so on. how can i code this differently. many thanks for the help guys, love this place Link to comment https://forums.phpfreaks.com/topic/195151-printing-results-from-query/ Share on other sites More sharing options...
wildteen88 Posted March 13, 2010 Share Posted March 13, 2010 Check out this FAQ Post it will help you out. Link to comment https://forums.phpfreaks.com/topic/195151-printing-results-from-query/#findComment-1025730 Share on other sites More sharing options...
jacko_162 Posted March 13, 2010 Author Share Posted March 13, 2010 works a treat. many thanks Link to comment https://forums.phpfreaks.com/topic/195151-printing-results-from-query/#findComment-1025734 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.