Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I would like to add $tjeneste_type to $row.
Can anybody tell me how to do that??
BR Soren
************The Code**************
Can anybody tell me how to do that??
BR Soren
************The Code**************
Edit - Petruchio Thu Oct 18 10:34:45 UTC 2001: Added code tags, cleaned up markup.#!/usr/local/bin/perl -wT use strict; use HTML::Template; use CGI; use DBI; my $cgi = new CGI; use constant TMPL_FILE => "$ENV{DOCUMENT_ROOT}/um/templates/status.tmp +l"; my $tmpl = new HTML::Template( filename => TMPL_FILE ); my $search = $cgi->param("search"); my $tjenestested = $cgi->param("tjenestested"); my $dbh = DBI->connect("um","","","mysql") || die "Could not connect: $DBI::errstr\n"; my %attr = ( dbi_fetchall_arrayref_attr => {} ); my $row = $dbh->selectall_arrayref("select fornavn, efternavn, cpr, ad +resse, zip, city, g_afsluttet, bemyndigelse_til from people where (id + like '%$search%')",\ %attr); my $tjeneste_type; if ($tjenestested =~ /^Konsulent/) { $tjeneste_type = 'kon'; } else { $tjeneste_type = 'um'; } #ADD $tjeneste_type to $row??? $tmpl->param( row => $row ); print "Content-type: text/html\n\n", $tmpl->output; $dbh->disconnect;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: ADD $tjeneste_type to $row
by jeroenes (Priest) on Oct 18, 2001 at 14:35 UTC | |
by tye (Sage) on Oct 18, 2001 at 19:56 UTC | |
Re: ADD $tjeneste_type to $row
by cfreak (Chaplain) on Oct 18, 2001 at 19:20 UTC |
Back to
Seekers of Perl Wisdom