in reply to Retrieving a message count on a thread using HTML::Template, and DBI.

Perhaps something like this?

... my $sql = 'select count(*) from replies where reply_id=?'; my $sth = $dbh->prepare($sql) or die $dbh->errstr; ... my $rc = $sth->execute($q->param('id')) or die $sth->errstr; my ($count) = $sth->fetchrow_array if ($rc == 1); ...

  • Comment on Re: Retrieving a message count on a thread using HTML::Template, and DBI.
  • Download Code