Hello, I am using a while loop to retrieve names from my database. After each name I have a line break (<br>) so it forms a list. However, I do not want it in one column, I would like to break it up into 3 columns. Does anyone know how to do this? Thank You, Jason
<?php $something = mysql_query("SELECT * FROM somewhere"); $column_count = 3; $i = 1; while ($row = mysql_fetch_array($something)) { if (is_int($i/$column_count)) { echo $row['your_value'], "<br>"; } else { echo $row['your_value'], " - "; // remove - symbol if you don't want to split columns } $i++; } ?> PHP:
The script you gave me displays each name 6 times. Also, is there a way to integrate an html table into that? Thank You
He EDITED the original script - did you test the script posted in the second post again? AFTER he edited it?
I don't see a second post with the edited script. I just see the first one. Do I not know how to use a forum?
It was edited, so the changes are reflected in the one and only post, by ActiveFrost, which says at the bottom "Last edited by ActiveFrost : Yesterday at 12:11 am." (though the specific time will be different if you are not in my time zone (Beijing/Singapore). If you open a document, edit it, and then hit "save", there is not suddenly a second document on your hard drive. There is just the first document, with the changes in it. Same deal here.
oooooooh! I am an idiot. I apologize. I was assuming you would have posted it in a second post. I do have one more quesion, how would I integrate an html table in that code? So that each name has its own <td> and there would be a new <tr> after 3 names. Thank You!