stonecolddevin has asked for the wisdom of the Perl Monks concerning the following question:
# select sub sub selectMsgFromDb { my ($self, %params) = @_; $self->checkRequiredParams(%params); my $sth = $dbh->prepare( $cfg->{retrieve_from_sql}->{msg} ); $sth->execute( ); my @msgs; while ( my $thread = $sth->fetchrow_hashref() ){ my (@data) = q[$thread->{id}, $thread->{name}, $thread->{date}, $thread->{subj}, $thread->{day_rate}, $thread->{msg}]; push @msgs, @data; } return @msgs; # code for returning the page my ($content); push @{$content}, $params{-content}; $template->param( MAIN_CONTENT=>$content ); return $template->output; # hash for sql my %sql = ( msg =>'SELECT id, name, date, subj, day_rate, msg FROM mes +sages ORDER BY DATE DESC', reply =>'SELECT id, name, date, subj, day_rate, msg FROM m +essages ORDER BY DATE DESC', insert =>'INSERT INTO ethereal VALUES(0, ?, ?, ?, NOW(), ? +)' );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTML::Template problems
by Coruscate (Sexton) on Dec 31, 2003 at 23:25 UTC | |
by stonecolddevin (Parson) on Dec 31, 2003 at 23:31 UTC | |
by stonecolddevin (Parson) on Dec 31, 2003 at 23:34 UTC | |
by jeffa (Bishop) on Jan 01, 2004 at 18:14 UTC | |
|
Re: HTML::Template problems
by tilly (Archbishop) on Dec 31, 2003 at 23:52 UTC | |
|
Re: HTML::Template problems
by cLive ;-) (Prior) on Jan 01, 2004 at 00:11 UTC | |
|
Re: HTML::Template problems
by cees (Curate) on Jan 01, 2004 at 21:28 UTC |