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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.