6 Einträge, 1 Seite |
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
#!/Perl/bin/perl -w
use DBI;
use DBD::mysql;
use CGI;
my $dbh = DBI->connect(
'DBI:mysql:logarit:localhost',
'',
'',
{ PrintError => 1, RaiseError => 1, "AutoCommit" => 1, },
) or print STDERR (
"Error in connecting to DBI:mysql:logarit:localhost\n",
die => 1); # immer Returncodes und Fehler auswerten!!!
my $cmd = qq~
SELECT BINARY grafik FROM grafik WHERE name='noname'
~;
my $sth = $dbh->prepare($cmd) or die $!;
$sth->execute() or die $!;
binmode STDOUT;
print "Content-type: image/gif\n\n";
my $grafik = $sth->fetchrow_array();
print $sth->fetchrow_array();
$sth->finish();
$dbh->disconnect();
exit(0);
1
2
3
4
5
6
7
8
9
10
11
BEGIN {
# Netscape, Roxen and Apache 2.0.something do not like warnings...
if (defined $ENV{SERVER_SOFTWARE} &&
$ENV{SERVER_SOFTWARE} =~ m{(netscape|roxen|apache/2\.0)}i
) {
open(STDERR, ">>/tmp/we_redisys_stderr.log");
print STDERR "--- Begin at @{[ scalar localtime ]} ---\n";
} else {
$^W = 1;
}
}
6 Einträge, 1 Seite |