8 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
use CGI;
use DBI;
my $DB_NAME = "usr_web288_1";
my $DB_DSN = "DBI:mysql:database=$DB_NAME";
my $DB_USER = "web288";
my $DB_PASSWD = "XXXXXXXXXXX";
my $dbh = DBI->connect($DB_DSN, $DB_USER, $DB_PASSWD) or die "Fehler bei Datenbankverbindung: $!";
my @DB_Felder = $dbh->list_fields('mails');
$sth = $dbh->prepare("LISTFIELDS $table");
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
48
49
50
51
52
53
54
sub new
{
my ($class, $dbh, $tabelle) = @_;
my $self = {}; &nb
sp;
$self->{tabelle} = $tabelle;
$self->{data} = $dbh->selectall_arrayref (
"Describe $tabelle")
or die escapeHTML ("Keine Infos zu $tabelle\n");
print "\n<BR> @{$self->{data}}[0]\n";
foreach( @{$self->{data}} ) {
# We could do this, but it only works for 4 elements
print "$_->[0], $_->[1] $_->[2] $_->[3]\n";
# Therefore, use the more general form.
print "\n";
}
# Zu jedem Spaltennamen einen Eintrag im $self-Hash
$self->{spalte} = {};
foreach my $spalte_ref (@{$self->{data}})
{
$self->{spalte}->{$spalte_ref->[0]} = $spalte_ref;
}
my $spalte_ref;
$self->{spalte}->{$spalte_ref->[0]} ="id";
$self->{spalte}->{$spalte_ref->[0]} ="PMID";
$self->{spalte}->{$spalte_ref->[1]} ="PDate";
$self->{spalte}->{$spalte_ref->[2]} ="Titel";
$self->{spalte}->{$spalte_ref->[3]} ="AuthorList";
$self->{spalte}->{$spalte_ref->[4]} ="SCIAuthorList";
$self->{spalte}->{$spalte_ref->[5]} ="Affiliation";
$self->{spalte}->{$spalte_ref->[6]} ="DOILINK";
$self->{spalte}->{$spalte_ref->[7]} ="Language";
$self->{spalte}->{$spalte_ref->[8]} ="AbstractText";
$self->{spalte}->{$spalte_ref->[9]} ="Volume";
$self->{spalte}->{$spalte_ref->[10]} ="Issue";
$self->{spalte}->{$spalte_ref->[11]} ="ISSN";
$self->{spalte}->{$spalte_ref->[12]} ="Journal";
$self->{spalte}->{$spalte_ref->[13]} ="PGVON";
$self->{spalte}->{$spalte_ref->[14]} ="PGBIS";
$self->{spalte}->{$spalte_ref->[15]} ="PTList";
$self->{spalte}->{$spalte_ref->[16]} ="MeshHeadingList";
return (bless ($self, $class));
}
8 Einträge, 1 Seite |