cliffrubinmusic has asked for the wisdom of the Perl Monks concerning the following question:
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>"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: very sloooooow!
by davido (Cardinal) on Apr 21, 2011 at 17:51 UTC | |
by believer (Sexton) on Apr 22, 2011 at 09:17 UTC | |
by cliffrubinmusic (Novice) on Apr 22, 2011 at 13:29 UTC | |
|
Re: very sloooooow!
by Old_Gray_Bear (Bishop) on Apr 21, 2011 at 17:11 UTC | |
|
Re: very sloooooow!
by eff_i_g (Curate) on Apr 21, 2011 at 17:27 UTC | |
|
Re: very sloooooow!
by SuicideJunkie (Vicar) on Apr 21, 2011 at 17:18 UTC |