Yes johanafm, my bad. I went through the code fast. Revision posted...
<?php
if([Whatever your condition is])
{
echo '<table>';
echo '<tr>';
echo '<th>Torrent Name</th>';
echo '<tr>';
while($row=mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>". $row['fieldname1'] ."</td>";
echo "<td>". $row['fieldname2']. "</td>";
echo "</tr>";
}
echo '</table>';
} else
{
echo "<p>Please enter a search query</p>";
}
?>
Perhaps in the future johanafm, you could post some helpful advice to the thread after you kick someone else trying to lend a helping hand?!? In any respect, it doesn't matter why he's doing a foreach on the outputted $row data - it isn't necessary.