Hello all,

I have quite a complicated question and it is mainly about how to process the data 
after I get it out of the database.

Here's what I have....

I have a CGI that has about 7 checkboxes in it ( a checkbox group).  When submitted it 
sends an array of the checkboxes that were checked in a variable.....

So if "Edte, Ecpp, Excdr and Eab" were checked, I'd get them back as the array values. 

These values tell me which fields of my query are to be displayed, so I setup a hash 
to correspond to the field in the database, as a few of them represent more than one 
field....

%dbfield = (
                'Edte' => [DATE],
                'Ecpp'  => [CPP],
                'Excdr' => [XCDR],
                'Eab'   => [ACCESS_BTS, ACCESS_SECTOR, ACCESS_CHANNEL]
        );


Now, by doing something like the following, I could put the fields into an array and 
then give that array to one of the DBI functions and it would spit out the values of 
each of these fields.

foreach $thing (keys %dbfield) {
                print "the members of $thing are:\n";
                foreach (@{$dbfield{$thing}}) {
                        print "\t$_\n";
           }
   }


Ok, now that that is all said.....we can get to the actual problem.....

I need to perform caclulations on the values as they come out of the database....does 
anyone know of a way to automate this.

I've thought of:

#db connect, prepare, exectute goes here....

while($ref = $sth->fetchrow_hashref()) {

foreach $opt (@enable_opts) { #@enable_opts is the array of checkbox values
        
        #switch statement to perform calculations on values ($ref{'DATE'})
        }
}

Other than that, I'm not sure how to go about this.

Any help is appreciated....

Kevin

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to