Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks,
I am new to perl, and I have been taking pieces and parts from other scripts I have found in an effort to try and get comfortable with perl. I am trying to query a database and display the information that I get on a webpage using HTML::Template.
Here is what I am using to get the data:
That gets my information out of the database, but how do I get that into HTML::Template? I have tried this:my $sth = $dbh->prepare( "SELECT alpha FROM main WHERE alpha LIKE '%$s +earch_ip %'" ); $sth->execute(); my ($complete_match) = $sth->fetchrow_array;
That gives me the follwoing error:$template->param(cm => $complete_match); print $CGI->header( ); print $CGI->title("returned data!"); print $template->output;
HTML::Template::param() : attempt to set parameter 'cm' with a scalar - parameter is not a TMPL_VAR! at /var/www/asd/www.pl line 60
If someone could point me in the right direction, it would be much appreciated.
Thank you very much.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: DBI, HTML::Template and loops
by bradcathey (Prior) on Apr 17, 2005 at 12:56 UTC | |
Re: DBI, HTML::Template and loops
by borisz (Canon) on Apr 17, 2005 at 09:28 UTC | |
by ghenry (Vicar) on Apr 17, 2005 at 16:00 UTC |
Back to
Seekers of Perl Wisdom