Hi, i have a piece of code that queries a database and then builds and output the data into forms. It works but it lists the data out in a line downwards. I need it to display them at 3 across and however many is needs downwards. Make sense? The code is below. I cannot count how many result the querie makes because there is no point. It builds the tables as it loops.
The code :-
$get_online= "
SELECT *
FROM $table_name
WHERE (broadcaster) = '$yes'
ORDER BY id
";
$get_online_res = @($get_online, $connection) or die("Bollox.");
while ($online_bd = mysql_fetch_array($get_online_res)) {
$id = $online_bd['id'];
$cat = $online_bd['cat'];
$username = $online_bd['username'];
$user_ip = $online_bd['ip_address'];
$age = $online_bd['age'];
$location = $online_bd['location'];
$description = $online_bd['description'];
$online_count++;
$laston = $online_bd['laston'];
$viewed = $online_bd['viewed'];
$type = $online_bd['type'];
if ($laston == "") {
$laston = "80";
}
if ($viewed == "") {
$viewed = "0";
}
$bd_string .= "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">
<tr>
<td>
<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">
<tr>
<td colspan=\"3\"><img width=\"242\" height=\"14\" src=\"livechat_index_border_01.gif\"></td>
</tr>
<tr>
<td><img width=\"58\" height=\"19\" src=\"livechat_index_border_02.gif\"></td>
<td width=\"144\" align=\"center\" bgcolor=\"#0099cc\" CLASS=\"room_namelabel\"><font color=\"#FFFFFF\" face=\"Arial, Helvetica, sans-serif\">$username</font></td>
<td><img width=\"40\" height=\"19\" src=\"livechat_index_border_03.gif\"></td>
</tr>
<tr>
<td colspan=\"3\"><img width=\"242\" height=\"9\" src=\"livechat_index_border_04.gif\"></td>
</tr>
</table>
<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">
<tr>
<td><img width=\"47\" height=\"25\" src=\"01cam.gif\"></td>
<td rowspan=\"7\">
<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">
<tr>
<td colspan=\"3\"><img width=\"166\" height=\"9\" src=\"livechat_index_border_05.gif\"></td>
</tr>
<tr>
<td><img width=\"11\" height=\"108\" src=\"livechat_index_border_07.gif\"></td>
<td width=\"144\" height=\"108\"><a href=\"javascript:window_live('live.php3?room=1&model=209','01')\"><img border=\"0\" width=\"144\" height=\"108\" src=\"userpics/$username.jpg\"></a></td>
<td><img width=\"11\" height=\"108\" src=\"livechat_index_border_08.gif\"></td>
</tr>
<tr>
<td colspan=\"3\"><img width=\"166\" height=\"9\" src=\"livechat_index_border_09.gif\"></td>
</tr>
</table>
</td>
<td rowspan=\"7\"><img width=\"29\" height=\"126\" src=\"livechat_index_border_06.gif\"></td>
</tr>
<tr>
<td><img width=\"47\" height=\"9\" src=\"livechat_index_border_10.gif\"></td>
</tr>
<tr>
<td><img width=\"47\" height=\"25\" src=\"livechat_index_button_chat.gif\"></td>
</tr>
<tr>
<td><img width=\"47\" height=\"8\" src=\"livechat_index_border_11.gif\"></td>
</tr>
<tr>
<td><img width=\"47\" height=\"25\" src=\"audio.gif\"></td>
</tr>
<tr>
<td><img width=\"47\" height=\"9\" src=\"livechat_index_border_12.gif\"></td>
</tr>
<tr>
<td><img width=\"47\" height=\"25\" src=\"ukflag.gif\"></td>
</tr>
<tr>
<td colspan=\"3\"><img width=\"242\" height=\"17\" src=\"livechat_index_border_13.gif\"></td>
</tr>
</table> ";
}
I would really appreciate some help on this as i have tried everything and i just about to give up.
Kind regards
Julian Chamberlain
julian.chamberlain@ntlworld.com