Quicksilver has asked for the wisdom of the Perl Monks concerning the following question:
Many thanks for your help, Iain#!c:\perl\bin\perl.exe use strict; use warnings; use CGI; use DBI; #calling the service overview tables my $q= new CGI; print $q->header(); print $q->start_html(-title=>'service metrics'); print qq[<form method="post"action="/cgi-bin/service.pl" name="metric" +>]; #code to create the scroll down box which selects from the db my $db = DBI->connect(foo, bar, baz {RaiseError => 1, AutoCommit => 1}); my $sth = $db->prepare("SELECT Name FROM service_metrics"); $sth->execute; my @data; while (my @result = $sth->fetchrow_array) { push @data,$result[0]; } print $q->scrolling_list(-name=>"metrics", -value=>"@data"); $sth->finish; $db->disconnect(); print $q->submit(-value=>"Choose"); print qq[</form>];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Getting a row rather than an expected scrolling list
by spatterson (Pilgrim) on Aug 16, 2007 at 10:55 UTC | |
|
Re: Getting a row rather than an expected scrolling list
by moritz (Cardinal) on Aug 16, 2007 at 10:57 UTC | |
|
Re: Getting a row rather than an expected scrolling list
by FunkyMonk (Bishop) on Aug 16, 2007 at 10:56 UTC |