Nathan Riley
asked on
PHP While Loop
In my while loop it puts the header to the tables after each username instead of just the first row.
Also how can I make the columns line up like maybe a set width or something?
while ($line= mysql_fetch_array($result))
{
echo '<table border="1" bordercolor="#FFCC00" style="background-color:#FFFFCC" width="400" cellpadding="3" cellspacing="3">
<tr>
<td>Username</td>
<td>Thread Count</td>
<td>Post Count</td>
<td>Points Total</td>
</tr>
</table>';
echo '<table border="1" bordercolor="#FFCC00" style="background-color:#FFFFCC" width="400" cellpadding="3" cellspacing="3">
<tr>
<td>' . $line['author_name'] . '</td>
<td>' . $line['thread_total'] . '</td>
<td>' . $line['post_total'] . '</td>
<td>' . (($line['post_total'] * $posts) + ($line['thread_total'] * $topics)) . '</td>
</tr>
</table>';
}
Also how can I make the columns line up like maybe a set width or something?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.