in reply to Re^7: MySQL INSERT in Perl
in thread MySQL INSERT in Perl

Now incorporate placeholders as described in the documentation for DBI. That's even more important lifestyle advice than actually solving your problem. :)


Dave

Replies are listed 'Best First'.
Re^9: MySQL INSERT in Perl
by baperl (Sexton) on Aug 04, 2011 at 20:14 UTC
    will do so:-)
      this is what I did, and it doesn't like it... I seem to run into problems using prepare/execute, and they seem to disappear when I use do
      my $ins_rec="INSERT INTO $table (symbol,valuation_dt,expn_dt,strike,op +en,bid,ask,last,volume) VALUES(?,?,?,?,?,?,?,?,?);"; # print "my ins_rec is $ins_rec\n"; my $sth=$dbh->prepare($ins_rec); $sth->execute(\'$h1{'symbol'}\',now(),\'$exp\',$h1{'strike'},$h1 +{'open'},$h1{'bid'},$h1{'ask'},$h1{'last'},$h1{'volume'});
        and I fixed everything...I'm using placeholders and all works. THANKS guys!