DBI data for a cgi pop-up

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,129
Messages
2,570,770
Members
47,329
Latest member
FidelRauch

Latest Threads

Top