Nar has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl use DBI; use strict; use Spreadsheet::Write; my $h=Spreadsheet::Write->new( file => 'file.csv', encoding => 'iso8859', ); #connect to MySQL my $dbh = DBI->connect(CONNECTION STRING HERE) or die "Can't connect to database\n"; my $sth_select = $dbh->prepare("SELECT id,overview FROM SOME_TABLE"); #EXECUTE SQL $sth_select->execute(); $h->addrow('productcode','overview'); while (my ($id,$overview) = $sth_select->fetchrow_array()) { print "$overview\n"; #PRINT CSV DATA $h->addrow($id,$overview); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTML entity write error
by roboticus (Chancellor) on Aug 23, 2013 at 02:22 UTC | |
by tobyink (Canon) on Aug 23, 2013 at 05:50 UTC | |
by roboticus (Chancellor) on Aug 23, 2013 at 11:44 UTC | |
by tobyink (Canon) on Aug 23, 2013 at 11:53 UTC | |
by ww (Archbishop) on Aug 23, 2013 at 14:31 UTC | |
|
Re: HTML entity write error
by 2teez (Vicar) on Aug 23, 2013 at 02:46 UTC | |
by Nar (Novice) on Aug 23, 2013 at 03:03 UTC |