php echo details into columns
Posted: Mon Aug 21, 2006 8:27 am
I can't figure out a bit of a problem that I think should be pretty simple.
I have a mysql atabase that contains a list of users, what I want to do is when the users are pulled from the database each user is displayed in a seperate column (up to 4 columns wide) and if there is more than 4 users then it starts a new row of them.
I know how to display the users all under each other 1 at a time but am struggling to figur eout gettign them to be displayed in the columns how I want them to be.
Is anyone able to help.
This is how I have it at the moment so it displays the users in their own rows.
Cheers
Wardy
I have a mysql atabase that contains a list of users, what I want to do is when the users are pulled from the database each user is displayed in a seperate column (up to 4 columns wide) and if there is more than 4 users then it starts a new row of them.
I know how to display the users all under each other 1 at a time but am struggling to figur eout gettign them to be displayed in the columns how I want them to be.
Is anyone able to help.
This is how I have it at the moment so it displays the users in their own rows.
Code: Select all
echo("<td width=".$tdwidth." bgcolor=".$bgcolor2.">");
echo("<font face=".$font.">");
echo("<font size=".$fontsize.">");
echo('<img src="http://www.mysite.com/img/' . $row["userid"] . 'th.jpg"><br><a href="http://www.mysite.com/' . $row["username"] . '" target="_blank">' . $row["username"] . '</a>');
echo("</tr>");Wardy