my $in_rec="INSERT INTO $table (name,trans_date,price) VALUES(\'$name\',\'$dt\',\'$prc\');"; my $sth=$dbh->prepare($in_rec); #### my $tdt="select str_to_date(\'$dt\','%m/%d/%Y');"; my $in_rec="INSERT INTO $table (name,trans_date,price) VALUES(\'$name\',\'$tdt\',\'$prc\');"; my $sth=$dbh->prepare($in_rec); #### DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '07/29/2011','%m/%d/%Y');','30.53')' at line 1 at test.pl line 34. SQL error:$DBI::errstr