in reply to SQL INSERTs don't work

This script works for me on linux with DBI 1.45 and DBD::SQLite 1.07. If you are testing only via the web, you should probably put in "use CGI::Carp qw(fatalsToBrowser)" to make sure you see error output. Although I wrote the test script you are using, I'm wondering if I was being too clever with the "if $sth->{NUM_OF_FIELDS}" since perhaps older versions of DBD::SQLite don't set NUM_OF_FIELDS (although they should, and do AFAIK). Just in case, try changing that to "if $sql =~ /^\s*SELECT/". If you continue to get errors, please show the results of DBI->installed_versions.

Replies are listed 'Best First'.
Re^2: SQL INSERTs don't work
by ido50 (Scribe) on Nov 09, 2004 at 20:29 UTC
    I have managed to gather up that the INSERT does work, but the thing that causes the problem is actually the fetching (or the dumping of the results). When using any of the following DBI functions: fetchrow_array, fetchrow_arrayref, fetchrow_hashref, dump_results, the program exits silently.

    Any thoughts on this one?

    -------------------------
    Live fat, die young