Hi,
I'm using FormBuilder 3.08 and I would like to have real labels on my form instead of just the column names. I'm thinking that it should be possible for me to put this label information into the Comments field for each column in the table. However....FormBuilder is just giving me labels with "1" in them. Here is my code. I'm on Windows XP SP3 using MySQL 5.2.44 and Active Perl 5.14.2. I've really tried to dig into this on the internet before asking..... Here is my code:
#------------------------------------------
# Get Label contents.
#------------------------------------------
$sqlstatement=qq/SELECT column_name, column_comment FROM information_schema.columns
WHERE table_name='preferences'
AND table_schema = 'hypersort';/;
my $label_sth = $dbh->prepare($sqlstatement);
$label_sth->execute() ||
die "Could not execute SQL statement ... maybe invalid?";
@label_contents=();
while(my($name) = $label_sth->fetchrow_array) {
push @label_contents, $name;
}
$label_sth->finish;
.
.
.
.
.
. Other stuff....
.
.
#------------------------------------------
# Init new form.
#------------------------------------------
my $form = CGI::FormBuilder->new(
title => 'HyperSort Default Settings',
fields => \@pref_fields,
values => $defs,
labels => \@label_contents,
submit => [qw/Cancel Update/],
stylesheet => '/scripts/conn2.css',
);
.
.
.
.
I'm pretty sure that my problem lies in how I'm getting the data into the hash. Any help would be appreciated, as always!
Harry Jamieson