tcf03 has asked for the wisdom of the Perl Monks concerning the following question:
here is the errormy @COLUMNS; push ( @COLUMNS, $_)for ( 1 .. $last_column ); my $column_list = map { print "field$_, " } @COLUMNS; my $placeholders = { print "?, " for ( 1 .. $last_column ) }; my $insert_data = $dbh->prepare(<<SQL); insert into $filename ($column_list) values ($placeholders) SQL foreach (<DATAFILE>) { my (@ROW) = split /,/, $_; my $row_list = map { print "\'$_\', " } @ROW; $insert_data->execute($row_list); }
DBD::mysql::db do failed: You have an error in your SQL syntax; check +the manual that corresponds to your MySQL server version for the righ +t syntax to use near '61 ) VALUES ( 61 )' at line 1 at ./generatefil +es.pl line 87, <DATAFILE> line 467.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: array as mysql db rows
by rnahi (Curate) on Sep 16, 2005 at 22:11 UTC | |
|
Re: array as mysql db rows
by graff (Chancellor) on Sep 16, 2005 at 21:56 UTC | |
|
Re: array as mysql db rows
by InfiniteSilence (Curate) on Sep 16, 2005 at 21:19 UTC |