It looks like you got part of your templates/codes mixed up. Try something along the lines of:
my $groups = $dbh->prepare(qq(select * from ForumGroups order by Title));
$groups->execute() or die $DBI::errstr;
while (my $g_rec = $groups->fetchrow_hashref()) {
my $subcats = '';
my $cats = $dbh->prepare(qq(select * from ForumCats where GroupID = "$g_rec->{'ID'}" order by Title));
$cats->execute() or die $DBI::errstr;
while (my $c_rec = $cats->fetchrow_hashref()) {
$subcats .= &site_html_forum_cat ( $c_rec );
}
$categories .= &site_html_forum_group ( $g_rec, $subcats );
}
my $index = &site_html_forum_home ( $categories );It doesn't look like you should be displaying both the 'Categories' and the 'Topics' this way... The topics should be passed into the 'Categories' template, then to the index page.
--Drew
Links 2.0 stuff
http://www.camelsoup.com
Code:
my $categories = ''; my $groups = $dbh->prepare(qq(select * from ForumGroups order by Title));
$groups->execute() or die $DBI::errstr;
while (my $g_rec = $groups->fetchrow_hashref()) {
my $subcats = '';
my $cats = $dbh->prepare(qq(select * from ForumCats where GroupID = "$g_rec->{'ID'}" order by Title));
$cats->execute() or die $DBI::errstr;
while (my $c_rec = $cats->fetchrow_hashref()) {
$subcats .= &site_html_forum_cat ( $c_rec );
}
$categories .= &site_html_forum_group ( $g_rec, $subcats );
}
my $index = &site_html_forum_home ( $categories );
--Drew
Links 2.0 stuff
http://www.camelsoup.com