Thread CSV Datei mit CGI öffnen (117 answers)
Opened by lolipop 999 at 2006-11-17 19:35

renee
 2006-12-06 08:45
#9049 #9049
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Poste mal die Ausgabe von
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/perl

use strict;
use warnings;

use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
use DBI;
#use HTML::Table;
use Data::Dumper;

print header('text/plain'),start_html();

my $dbh = DBI->connect("DBI:CSV:f_dir=f:/Apache2/cgi-bin/")
or die "Konnte Datenbank nicht oeffnen! $!";

my $stmt = "SELECT * FROM Kunden";
my $sth = $dbh->prepare($stmt) or die $dbh->errstr;
$sth->execute() or die $dbh->errstr;

#my $table2 = new HTML::Table;
#$table2->addRow('DHL','K_N','Hellmann');
my @results;
while(my @cell_values = $sth->fetchrow_array()){
# $table2->addRow(@cell_values);
push @results,[@cell_values];
}

print Dumper(\@results);
#$table2->print;

$dbh->disconnect;
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/
Antworten mit Zitat

View full thread CSV Datei mit CGI öffnen