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

hi Dave, I've updated the code and $ins_rec prints nothing

Replies are listed 'Best First'.
Re^3: MySQL INSERT in Perl
by davido (Cardinal) on Aug 04, 2011 at 16:44 UTC

    "I've updated the code and $ins_rec prints nothing"

    That's a big problem, right? So you now have two jobs:

    First: find out why $ins_rec is empty when you try to send an INSERT to MySQL.

    Second: Convert your program to use placeholders so that you are not subjecting yourself to possibly corrupt SQL or SQL injection attacks due to unescaped metacharacters.


    Dave

      hi Dave, I got it to work, and the $ins_rec is printing what it should. the insert is also working, and I checked the database to make sure it is all correct, and it is. however, I get this error message for the do():
      DBD::mysql::db do failed: Unknown column 'N' in 'field list' at otest. +pl line 52.
      I just posted the revised code in my new reply.

        I can't provide any additional help without knowing what $ins_rec looks like when you print it immediately prior to preparing your query.


        Dave