rendered paste body<table><?php//pseudo codeinclude("Template_System.php");//or w/e$template = new Template;$sql = '....';while($r = mysql_fetch_array($sql)){ $template->getTpl("category"); $template->replaceVars(array("{TITLE}" => $r['title'])); $template->publish(); //select forums in this category.. $sql2 = "SELECT * FROM .... WHERE `parent` = '".$r['id']."' "; while($s = mysql_fetch_array($sql2)) { $template->getTpl("forums"); $template->replaceVars(array("{TITLE}" => $s['title'])); $template->publish(); }}//Note all the templates must not contain table tags...?></table>