#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
use CGI qw/:all/;
use DBI;

$datfile="/home/websites/arabdemog_com/tree/MPPMembers.csv";
my $dbh=DBI->connect('dbi:mysql:arabdemog_com:arabiandemographics.com','arabdemog_com','p2a9r7cd') || die('cannot conect to database');

	open (DAT, "$datfile") || die ("Could not open file. $!");
	while ($line = <DAT>) {
		#$line = ~ s/\n//g;
		#$line = ~ s/\r//g;
		#$line = ~ s/ //g;
      my($email,$pwd)=split(/,/,$line);

	  #print "$email\n";
	  $sql="insert into tbl_artothprivmpp(email,pwd,brd,sub,dattill) values('$email','$pwd','2801,2802,2805,2813,2820,2829','MPP Arabia Subscription','2006-03-30')";
	  #print "$sql\n";
		$sthE=$dbh->prepare($sql)|| print('unable to prepare');
		$rv=$sthE->execute || print('unable to execute');
   }

   close(DAT);

	########################################
