[Chicago-talk] humbling question

Richard Reina richard at rushlogistics.com
Wed Sep 19 06:18:03 PDT 2007


I am trying to write a simple program like the one below that lets users at a console select an active employee.  However, because they are not supposed to see the employee's employee number I can't figure out a way to let them make the selection.   I thought I could do it with a counter ($i) but don't know of a way to associate the date with the count.  Any ideas would be greatfully appreciated.

Thanks,

Richard

#!/usr/bin/perl -w

my $q = "SELECT emp_no, first_name, last_name, mobile_ph
 FROM employee
 WHERE end_date IS NULL"
my $sth->prepare($q);

my ($emp_no, $f_name, $l_name, $ph);
$sth->execute();
$sth->bind_columns(\($emp_no, $f_name, $l_name, $ph);

my $i;
while($sth->fetch) {
    $i++;
    print $i . " " . $name . " " $f_name . " " . $l_name . " " . $ph ."\n";
}

print "Somehow make a selection based on what you're allowed to view\n";
my ($sel = <STDIN>);



Your beliefs become your thoughts.  Your thoughts become your words.  Your words become your actions.  Your actions become your habits.  Your habits become your values.  Your values become your destiny.  -- Mahatma Gandhi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/chicago-talk/attachments/20070919/f25c791e/attachment.html 


More information about the Chicago-talk mailing list