in reply to Re^6: Writing NULL values to a MySQL record via DBI
in thread Writing NULL values to a MySQL record via DBI

The first argument is your SQL statement. The second argument is a special thing. Just ignore it and use what i provided until you understand. The remaining arguments are your values you want inserted.

Finish writing the code i provided and run it and see what happens. Let us know.

  • Comment on Re^7: Writing NULL values to a MySQL record via DBI

Replies are listed 'Best First'.
Re^8: Writing NULL values to a MySQL record via DBI
by ureco (Acolyte) on Feb 26, 2015 at 23:31 UTC
    Ok, Thanks - really appreciate your help. Need to fix a few other parts of my code before I can run it again - which I'll do tomorrow as it's late here! I'll update the code with that you have written and let you know - Thanks again.
      You are welcome. Thank you in return for simply having the desire to write more secure (and maintainable) code. :)

      If you have more questions i recommend starting a new thread tomorrow, and reference this one to let others know what advice has been given so far. Good luck!

        It worked, :o) the values that are not defined in the CSV file are now being written as NULL's in the database. Huge thanks, I need to read up on what exactly the second variable (containing the undef) is doing, I think I get the rest of it, but most of the simple examples only show a like for like match on the placeholders to the variables. But, that is for additional knowledge - my immediate problem is resolved.