in reply to (jeffa) Re: Problems using DBD::CSV
in thread Problems using DBD::CSV
Some more code for your viewing (dis)pleasure:
$info{PATH_BASE} . $info{PATH_DATA} turn out to be /www/cromedome.net/data/, which is what they should have been. It seems I never make it into while loop - I don't think that I'm pulling any data whatsoever. Should I execute that after the execute() and before the while()?my $files = $info{PATH_BASE} . $info{PATH_DATA}; my $filehandle = DBI->connect("DBI:CSV:f_dir=$files"); or die "Could not connect to database: " . DBI->errstr; $script = "SELECT Drafted, " . " Team, " . " Owner, " . " Location, " . " Age " . " FROM owners " . " ORDER BY Drafted ASC " ; $sql = $filehandle->prepare($script) || die "Couldn't prepare SQL: " . $filehandle->errstr; $sql->execute() || die "Couldn't prepare SQL: " . $filehandle->errstr; while (my $row = $sql->fetchrow_hashref) { my %row_data; $row_data{TEAM} = $row->{'Team'}; push(@table, \%row_data); } $sql->finish(); $tmpl_owners->param( LEAGUENAME => $info{LEAGUENAME}, TEAMS => \@table ); return $tmpl_owners->output;
MrCromeDome
|
|---|