MySQL Forums
Forum List  »  Perl

Re: fetch a problem to insert values in perl programming
Posted by: arupratan biswas
Date: May 18, 2005 06:21AM

still now its not work felix,same error are remain there.right now my code is as following
$dbh = DBI->connect("dbi:mysql:test:","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;

die "Could not execute SQL statement ... maybe invalid?";

i cant understand my fault,plz help felix
arup ratan

Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.