Thread suchen und vergleichen (124 answers)
Opened by Kathrin at 2004-12-16 16:21

renee
 2004-12-16 16:37
#32654 #32654
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
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
33
34
35
36
37
38
39
40
41
42
43
44
sub suchen { 
my $db="DBI:mysql:produkte";
my $user="";
my $pass="";
my $dbh = DBI->connect($db,$user,$pass) or die $DBI::errstr;
my $statement_suchen="SELECT * FROM tbl0011990 where ident_nr = '$identnr'";
my $sth_suchen=$dbh->prepare($statement_suchen) or die $DBI::errstr;
$sth_suchen->execute;
my %hash;
while (my @row = $sth_suchen->fetchrow_array()) {
$hash{identnr} = $row[0];
$hash{doctyp} = $row[2];
$hash{docname} = $row[3];
$hash{head_de} = $row[4] if ($row[1] eq 'DE');
$hash{head_en} = $row[4] if ($row[1] eq 'EN');
$hash{head_fr} = $row[4] if ($row[1] eq 'FR');
$hash{deutsch} = $row[5] if ($row[1] eq 'DE');
$hash{englisch} = $row[5] if ($row[1] eq 'EN');
$hash{franz} = $row[5] if ($row[1] eq 'FR');
$hash{ersteller}= $row[7];
$hash{werk} = $row[8];
$hash{check1} = $row[9];
$hash{check2} = $row[10];
$hash{check3} = $row[11];
$hash{check4} = $row[12];
}

my $stmt_docnames = "SELECT docnames FROM tbl0011990 WHERE ident_nr = ?";
my $sth_docnames = $dbh->prepare($stmt_docnames) or die $dbh->errstr();
$sth_docnames->execute() or die $dbh->errstr();
my %hash_docs;
while(my ($doc) = $sth_docnames->fetchrow_array()){
$hash_docs{$doc}++;
}
if(scalar(keys(%hash_docs)) > 1){
doc_vorhanden(%hash_docs);
}
else{
such_eintr(\%hash);
}

$sth_suchen->finish();
$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/

View full thread suchen und vergleichen