Hello, 

I am having trouble collecting the information from a text file that is 
parsed and then delete the information from the current table and import the 
updated information in the table. The delete statement works but when i go to 
import into the table i get this error:
DBD::mysql::st execute failed: Query was empty at ./cimugd.cgi line 27, <GD> 
line 1.
Error2 executing bind
Query was empty at ./cimugd.cgi line 27, <GD> line 1.


any help will be greatly appreciated thanks..

heres the actual script:

$dbh = DBI->connect($database, $username, $passwd) || die "Error connecting" 
.. $dbh->errstr;
 
&delete_db;
 
open(GD, "$ktjpath/$ktjlist") || &death("Can't open $ktjlist: um121");
while (<GD>){
        ($id, $number2, $number3, $fname, $email, $cemail, $passwd, $code, 
$stuff, $stuff2) = split /\|/;
        $sql_statment = "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() || die "Error2 executing bind\n" . $sth->errstr;
}
close GD;
 
close STDERR;
 
#######subroutines#########
 
sub delete_db{
 
$sth = $dbh->prepare("DELETE from ktj") || die "3: " . $dbh->errstr;
$sth->execute();
 
}
 

 

Reply via email to