Hi everyone,

I`m trying to send out an email containing all details of a small 
database(around 1000 sets of data).

Everybody who has entered an email address is supposed to receive only  
his data. The code I wrote (see below) seemed to work ok, but when 
testing I realized that everything is messed up.
Several users get their own data and other data, some only get the data 
of other users.

I`m not really sure how to solve that problem. I was thinking of maybe 
using a hash, but I got no idea on how to get all the data into the 
hash in some kind of an organized way (I`m still a newbie and have lots 
of things to learn..)

Any help or hints would be greatly appreciated.


Best regards,

Sven

my $dbh = DBI->connect( $dsn, $db_user, $db_pass ) || die "danger 
$DBI::errstr\n";
my $sth = $dbh->prepare( "select * from memberscopy " );
$sth->execute();
while (($id, $surname, $name, $count_res, $E_cont_e, $E_cont_f, $rank, 
$cname, $caddress, $ctel,
                $cfax, $cmobile, $cemail, $curl, $btype, $hq, $quali, $experi, 
$inhouse, $resid, $ptel, $pfax,
                $pmobile, $pemail, $birthday, $marital, $spouse, $children_names, 
$children_number, $hobbies,
                $membership, $pcont, $permtel, $permfax, $course, $nation, $lastup, 
$loginid, $password,
                $japan_row, $E_membership_paid, $E_membership_expires,
                $face) = $sth->fetchrow_array ) {
                
                unless ($E_cont_e eq "") {my $recipient = $E_cont_e }
                else {
                         if ($pemail ne "") { $recipient = $pemail }
                         elsif ($cemail ne "") { $recipient = $cemail }
                         }      

#below here is only MIME::LITE sending the email        

}


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

Reply via email to