Re: fetch a problem to insert values in perl programming
still now its not work felix,same error are remain there.right now my code is as following
$dbh = DBI->connect("dbi:mysql:test:192.168.0.95","bobby","bobby");
my $sqlstatement = qq{
INSERT INTO new_user
(emp_id, emp_name, emp_add, city, zip_code, dob, phone)
VALUES(?, ?, ?, ?, ?, ?, ?)
};
#$sqlstatement="INSERT INTO new_user (emp_id,emp_name,emp_add,city,zip_code,dob,phone,photo) VALUES($emp_id,'$emp_name','$emp_add','$city',$zip_code,'$dob','$phone','$photo')";
my $sth = $dbh->prepare($sqlstatement) or die "Could not prepare statement: $DBI::errstr";
$sth->execute($emp_id, $emp_name, $emp_add, $city, $zip_code, $dob, $phone, $photo)
or die "Could not execute: $DBI::errstr;
#$sth->execute()||
die "Could not execute SQL statement ... maybe invalid?";
i cant understand my fault,plz help felix
arup ratan