data67 has asked for the wisdom of the Perl Monks concerning the following question:
###setup my dropdown my @employee; while (@row = $sth->fetchrow_array) { # Used with arrays # handle null and undef's $last_name = (defined $row[2]) ? $row[2] : ''; push @employee, $last_name; }
foreach (@employee) { print "<option value=$_>$_\n"; }
PROBLEM
Here is the problem. As you can see i am pulling in JUST the last name, which is
not unique. I have several people with the same last name.
What i need is somtheing like this
<option value=SS_NUMBER>FIRST_NAME LAST_NAME
my @employee; while (@row = $sth->fetchrow_array) { # Used with arrays # handle null and undef's $SS_NUMERB = (defined $row[0]) ? $row[0] : ''; $first_name = (defined $row[1]) ? $row[1] : ''; $last_name = (defined $row[2]) ? $row[2] : ''; push @SS_NUMBER, $SS_NUMBER; push @employee_firstname, $first_name; push @employee_lastname, $last_name; }
<option value=$SS_NUMBER>$employee_FIRSTNAME $employee_LAST_NAME
One note however, i will still need a SS_number variable alone for further processing other than this.
thanks,
;-}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using DBI oracle to make scrolling lists(drop down menus)
by thunders (Priest) on Jan 22, 2002 at 06:23 UTC | |
by rdfield (Priest) on Jan 22, 2002 at 15:50 UTC | |
|
Re: using DBI oracle to make scrolling lists(drop down menus)
by jonjacobmoon (Pilgrim) on Jan 22, 2002 at 04:51 UTC | |
|
Re: using DBI oracle to make scrolling lists(drop down menus)
by wardk (Deacon) on Jan 22, 2002 at 05:23 UTC | |
by data67 (Monk) on Jan 22, 2002 at 05:26 UTC | |
|
Re: using DBI oracle to make scrolling lists(drop down menus)
by data67 (Monk) on Jan 22, 2002 at 05:23 UTC | |
by thunders (Priest) on Jan 22, 2002 at 17:23 UTC | |
|
Re: using DBI oracle to make scrolling lists(drop down menus)
by nandeya (Monk) on Jan 23, 2002 at 00:47 UTC |