buffmin Posted June 4, 2012 Share Posted June 4, 2012 I pull an array from a database ( a column of vendor types ) and I echo the array elements all on one line. I am trying to echo out 5 elements per line, and the line feed (< /br>). I have tried every combination of "if" and "for" loops and cannot get it to work and would appreciate it if someone could please help me. Thank you. Here is a link to my site http://inthestickspaintball.com/members/edit.php ... and here is my code. <?php require ('logininfo.php'); $db = connectDB(); $result = mysql_query("SELECT distinct Vendors FROM Selections order by Vendors asc") or die(mysql_error()); while($row = mysql_fetch_array( $result )) { echo $row['Vendors']; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/263644-trying-to-display-contents-of-array-in-rows-of-5-elements-then-line-feed/ Share on other sites More sharing options...
litebearer Posted June 4, 2012 Share Posted June 4, 2012 this may help ... http://www.phpfreaks.com/forums/index.php?topic=95426.0 Quote Link to comment https://forums.phpfreaks.com/topic/263644-trying-to-display-contents-of-array-in-rows-of-5-elements-then-line-feed/#findComment-1351127 Share on other sites More sharing options...
buffmin Posted June 4, 2012 Author Share Posted June 4, 2012 Excellent! Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/263644-trying-to-display-contents-of-array-in-rows-of-5-elements-then-line-feed/#findComment-1351134 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.