I've got this code working, but the return data, which is about 20,000 rows and 96 columns takes over 10 minutes to finish showing up in Mozilla firefox. Does anyone see a way to speed this up? Thanks in advance for any help you can give me.
Cliff
sub getQuestionaire {
my($col, $count);
$count=0;
text('Here is the questionaire info:');
print "<table width='340' border='1' cellspacing='1' cellpadding='1'>"
+;
print "<tr>";
foreach $col(@cols){
print "<td><b>$col</b></td>";
}
print "</tr>";
my $table='p_questionnaire';
my $fields=join(",",@cols);
my($sth);
my $sql = qq{SELECT $fields FROM $table ORDER BY patient_id};
$sth = $dbhSt->prepare($sql);
$sth->execute;
my %rec =();
$sth->bind_columns(map {\$rec{$_}} @cols);
while ($sth->fetchrow_arrayref){
if($count eq 25){
print "<tr>";
foreach $col(@cols){
print "<td><b>$col</b></td>";
}
print "</tr>";
$count=0;
}
print "<tr>";
foreach $col(@cols){
my $val= $rec{$col};
if($val eq ''){
$val='NULL';
}
print "<td>$val</td>";
}
print "</tr>";
$count=$count +1;
}
$sth->fetchrow_arrayref;
$sth->finish;
print "</table>";
}