B
Bill McCormick
Hi all,
I'm looking for the wiz bang way to fetch id=name values from a data base
ready to use for a call to the CGI.pm popup_menu command.
Of course I could do this programatcily. But since I exhibit a certain
amount of laziness, I'd like to know how to do this in as few steps as
posible.
Currently, I'm trying
my $array_ref = $dbh->selectcol_arrayref(qq/
SELECT id, name
FROM foo
ORDER BY name/,
{Columns=>[1,2]});
and then
$q->popup_menu(-name=>'selection',-values=>\@values,-labels=>\%labels);
where %labels = @$array_ref # that was easy enough
but then ... I'm stuck ...
@values = ????? # what
Am I missing the plainly obvious here? Is there maybe another DBI call that
would make this all happen in one fell swoop?
Thanks,
Bill
I'm looking for the wiz bang way to fetch id=name values from a data base
ready to use for a call to the CGI.pm popup_menu command.
Of course I could do this programatcily. But since I exhibit a certain
amount of laziness, I'd like to know how to do this in as few steps as
posible.
Currently, I'm trying
my $array_ref = $dbh->selectcol_arrayref(qq/
SELECT id, name
FROM foo
ORDER BY name/,
{Columns=>[1,2]});
and then
$q->popup_menu(-name=>'selection',-values=>\@values,-labels=>\%labels);
where %labels = @$array_ref # that was easy enough
but then ... I'm stuck ...
@values = ????? # what
Am I missing the plainly obvious here? Is there maybe another DBI call that
would make this all happen in one fell swoop?
Thanks,
Bill