Leser: 1
|< 1 ... 5 6 7 8 9 >| | 82 Einträge, 9 Seiten |
dir F:\Apache2\cgi-bin
rename F:\Apache2\cgi-bin\Kund.cvs F:\Apache2\cgi-bin\Kunde
Quotemuss man das leicht genau so dem script mitteilen
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!f:/perl/bin/perl
use strict;
use warnings;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
use GD::Graph::pie;
use DBI;
use FindBin;
### Datenbankverbindung ###
my $dbh = DBI->connect("DBI:CSV:f_dir=".$FindBin::Bin.";csv_sep_char=\\;") or die $DBI::errstr;
my $stmt = "SELECT * FROM Kunde";
my $sth = $dbh->prepare($stmt) or die $dbh->errstr();
$sth->execute() or die $dbh->errstr();
my @res;
while (my @werte = $sth->fetchrow_array()) {
push @res, [@werte];
}
$sth->finish();
$dbh->disconnect;
### Grafikeigenschaften festlegen ###
my $graph = new GD::Graph::pie(300, 300);
$graph->set(
title => 'Auswertung',
label => 'Category',
axislabelclr => 'black',
'3d' => 1,
start_angle => 90,
suppress_angle => 5,
)
or die $graph->error;
### Ausgabe ###
my $format = $graph->export_format;
print header("image/$format");
binmode STDOUT;
my $gd = $graph->plot(\@res) or die $graph->error;
print $gd->gif();
1
2
3
4
my @res = qw(DHL K_N Hellmann);
while (my @werte = $sth->fetchrow_array()) {
push @res, [@werte];
}
|< 1 ... 5 6 7 8 9 >| | 82 Einträge, 9 Seiten |