OK, guys here is whats up:
BACKGROUND
I am setting up a drop-down menu (scrolling list) and filling it like so:
###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;
}
And using it like so:
foreach (@employee) {
print "<option value=$_>$_\n";
}
All of this is working just fine.
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
This requres that i pull out two more fields. Which i think can be done as above also:
Somthing like so:
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;
}
How can i set this up to display like this, and fill my scrolling list:
<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,
;-}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.