Código PHP:
$ConCat = mysql_query("SELECT * FROM rr_fo_cat");
while($DatCat=mysql_fetch_array($ConCat)){
echo '<table width="680" align="center" style="border-collapse: collapse;"><tr><td>';
$Catid = $DatCat["id"];
echo $DatCat["nombre"];
echo "</td></tr><tr><td>";
echo '<table border="1" bgcolor="252424" width="680" style="border-collapse: collapse;"><tr><td width=\"350\">';
echo "Nombre del Foro</td>";
echo "<td width=\"75\" align=\"center\">Temas</td>";
echo "<td width=\"75\" align=\"center\">Posts</td>";
echo "<td width=\"200\" align=\"center\">Ultimo Tema</td>";
$ConFor = mysql_query("SELECT * FROM rr_fo_foros WHERE id_cat='$Catid'");
while($DatFor = mysql_fetch_array($ConFor)){
echo '<tr bgcolor="444444"><td valign="top"><a href="?pagina=foro&fid='.$DatFor["id"].'">'.$DatFor[nombre]."</a><br>".$DatFor[descripcion]."</td>";
echo '<td align="center">'.$DatFor[ntemas].'</td>';
echo '<td align="center">'.$DatFor[nposts].'</td>';
$Forid = $DatFor[id];
//tema en foro
$ConTem = mysql_query("SELECT * FROM rr_fo_temas WHERE id_foro='$Forid' ORDER BY id DESC LIMIT 0,1");
$DatTem=mysql_fetch_array($ConTem);
$ufecha = date("d/m/Y g:ja",$DatTem["ultimo"]);
if($DatTem[ultimo] == 0){
$ufecha = "";
}
echo "<td>";
echo "> ".$ufecha."<br/>";
echo "<b>En: </b><a href=\"?pagina=foro&fid=".$Forid."&tid=".$DatTem["id"]."\">".$DatTem[titulo]."</a><br/>";
echo "<b>Por: </b><a href=\"?pagina=usuario&accion=perfil&id=".$DatTem["id_usuario"]."\">".$DatTem[usuario]."</a>";
echo "</td>";
}
echo "</tr></table>";
echo "</td></tr></table>";
}