Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Re: GROUP BY problems

Quote Reply
Re: GROUP BY problems In reply to
It looks like you got part of your templates/codes mixed up. Try something along the lines of:

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 );
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
Subject Author Views Date
Thread GROUP BY problems Stealth 6108 Jul 8, 2001, 3:30 PM
Thread Re: GROUP BY problems
sponge 5964 Jul 8, 2001, 11:35 PM
Thread Re: GROUP BY problems
Stealth 5960 Jul 10, 2001, 5:44 PM
Thread Re: GROUP BY problems
sponge 5966 Jul 10, 2001, 7:53 PM
Thread Re: GROUP BY problems
Stealth 5956 Jul 10, 2001, 8:12 PM
Thread Re: GROUP BY problems
sponge 5952 Jul 11, 2001, 1:41 AM
Thread Re: GROUP BY problems
Stealth 5943 Jul 11, 2001, 4:54 PM
Thread Re: GROUP BY problems
sponge 5908 Jul 21, 2001, 8:20 PM
Thread Re: GROUP BY problems
Stealth 5909 Jul 22, 2001, 9:41 PM
Thread Re: GROUP BY problems
sponge 5906 Jul 22, 2001, 11:41 PM
Post Re: GROUP BY problems
Stealth 5887 Jul 23, 2001, 7:41 AM