Jump to content

Trying to display contents of array in rows of 5 elements, then "line feed"


buffmin

Recommended Posts

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'];
        } 
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.