G
Greg G
Here's what I'm trying to do:
my $sql1 = "select location, location_name from location_names order by
location";
$all_locs = $dbh->selectall_hashref($sql1, "LOCATION");
print "<tr><td>\n";
print "<select name='available_locations' multiple size=20
style='width:150'>\n";
print optgroup (-name=>"available_locations", -values => \%$all_locs );
print "</select></td>\n";
Should be pretty simple, right? Except that it doesn't work! The
option group gets generated with stuff like this:
<option value="LOC1">HASH(0xa381bbc)</option>
The LOC1 is, of course, correct. However, that HASH reference sure
isn't the location name. What am I doing wrong here? This seems like
it should be straightfoward, but I've tried a ton of variations, and
nothing seems to help.
Thanks.
-Greg G
my $sql1 = "select location, location_name from location_names order by
location";
$all_locs = $dbh->selectall_hashref($sql1, "LOCATION");
print "<tr><td>\n";
print "<select name='available_locations' multiple size=20
style='width:150'>\n";
print optgroup (-name=>"available_locations", -values => \%$all_locs );
print "</select></td>\n";
Should be pretty simple, right? Except that it doesn't work! The
option group gets generated with stuff like this:
<option value="LOC1">HASH(0xa381bbc)</option>
The LOC1 is, of course, correct. However, that HASH reference sure
isn't the location name. What am I doing wrong here? This seems like
it should be straightfoward, but I've tried a ton of variations, and
nothing seems to help.
Thanks.
-Greg G