Hello,
I am trying to open up a text file where each field is parsed by |.
the problem is that its only reading the first line in the text file. I want
it to loop throughtout the the textfile and insert in a DB.
ANyhelp is appreciated...thnx
the code is:
open(GD, "$ktjpath/$ktjlist") || &death("Can't open $ktjlist: um121");
while (<GD>){
($id, $number2, $number3, $fname, $email, $cemail, $passwd, $code,
$stuff, $stuff2) = split /\|/;
$sql_statement = "INSERT INTO ktj (number2, number3, fname, email, cemail,
passwd, code, stuff, stuff2) values (?, ?, ?, ?, ?, ?, ?, ?, ?)";
$sth = $dbh->prepare($sql_statement) || die "Error1 preparing insert
statement:\n" . $dbh->errstr;
$sth->execute($number2, $number3, $fname, $email, $cemail, $passwd,
$code, $stuff, $stuff2) || die "Error2 executing bind\n" . $sth->errstr;
}
close GD;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]