...

View Full Version : Table not outputting



Webmonkey
03-20-2007, 08:44 PM
Hi,
I am using the code below and the table doesn't seem to be outputting anything such as the remove, just the name, email, gender and ban. Anyone know why it's not working?
Thanks
Steven


$result = mysql_query($query) or die(mysql_error());
echo '<table width="1000" border="0.5">
<tr>
<td width="93">Username:</td>
<td>Email:</td>
<td>Gender:</td>
<td>Banned:</td>
<td>Edit:</td>
<td>Remove:</td>
<td>Ban:</td>
<td>Make Admin: </td>
</tr>';
while($row = mysql_fetch_array($result))
{

echo '
<tr>
<td width="93">'. $row['username'].' </td>
<td width="93">'. $row['email'].' </td>
<td width="93">'. $row['gender'].' </td>
'; if ($row['ban'] == 1)

{
echo '<td width="93"><a href="index.php?ACT=03&id='.$row['id'].'">Unban</a></td>';
} else
{
echo '<td width="93"><a href="index.php?ACT=03&id='.$row['id'].'">Ban</a></td>';
} ;'
<td width="93"></td>
<td width="93"><a href="index.php?ACT=04&id='.$row['id'].'">Remove</a></td>
<td width="93">&nbsp;</td>
<td width="137">123</td>
</tr>';

}
echo '</table>';

Fumigator
03-20-2007, 08:57 PM
You ended your first 'echo' statement just before your 'if' statement and you didn't fire up another 'echo' statement for everything below the 'if' statement.

Webmonkey
03-20-2007, 09:07 PM
so what would be the code to fix this?

aedrin
03-20-2007, 10:05 PM
It should be an easy thing to fix, but...



{
echo '<td width="93"><a href="index.php?ACT=03&id='.$row['id'].'">Ban</a></td>';
} ;'
<td width="93"></td>
<td width="93"><a href="index.php?ACT=04&id='.$row['id'].'">Remove</a></td>


to



{
echo '<td width="93"><a href="index.php?ACT=03&id='.$row['id'].'">Ban</a></td>';
} ;
echo '
<td width="93"></td>
<td width="93"><a href="index.php?ACT=04&id='.$row['id'].'">Remove</a></td>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum