The better way of doing is use table tag and then in table use cellspacing=0 and cellpading=0 will reduce to min space b/w lines.
use like this
<?
include("dbinfo2.inc.php");
$con = mysql_connect('localhost', $username, $password) or die('Unable to connect to localhost');
mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM phpbb_topics ORDER BY topic_last_post_id DESC LIMIT 5";
$result=mysql_query($query);
$num=mysql_num_rows($result);
mysql_close();
echo "<table cellspacing=0 cellpading=0>";
while ($row = mysql_fetch_array($result)) {
$topic_id = $row["topic_id"];
$topic_title = $row["topic_title"];
?>
<tr><td align=left>
<font face="Arial Narrow" size="2"><?echo "<a href='".$forumroot."viewtopic.php?t=".$topic_id."'>$topic_title</a>$topic_time";?></font></td></tr>
<?
}
?>
</table>