7 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
my $select1 = "select distinct b.carrier, b.boxno, b.listno, b.shipno, b.custno
from data1 b
where b.custno = 160
order by b.listno ";
my $sth = $dbhandle1->prepare($select1);
$sth->execute();
print "carrier,boxno,listno,shipno,custno\n";
while (my $hash_ref = $sth->fetchrow_hashref) {
print "$hash_ref->{carrier},";
print "$hash_ref->{boxno},";
print "$hash_ref->{listno},";
print "$hash_ref->{shipno},";
print "$hash_ref->{custno}\n";
}
use CGI qw(:all);
1
2
3
4
foreach $boxno ( "liste-alles-boxno's der vorherigen abfrage" ) {
"select blah from db-x where xyz = $boxno"
"zeige Ergebnis der Abfrage acuh wieder als Tabelle"
}
1
2
3
4
5
6
7
8
print "carrier,boxno,listno,shipno,custno\n";
while (my $hash_ref = $sth->fetchrow_hashref) {
print "$hash_ref->{carrier},";
print "$hash_ref->{boxno},";
print "$hash_ref->{listno},";
print "$hash_ref->{shipno},";
print "$hash_ref->{custno}\n";
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
print "<table border=1>\n".
" <th>carrier</th>\n".
" <th>boxno</th>\n".
" <th>listno</th>\n".
" <th>shipno</th>\n".
" <th>custno</th>\n";
while (my$hash_ref = $sth->fetchrow_hashref) {
print " <tr>\n";
print " <td>$hash_ref->{carrier}</td>\n";
print " <td>$hash_ref->{boxno}</td>\n";
print " <td>$hash_ref->{listno}</td>\n";
print " <td>$hash_ref->{shipno}</td>\n";
print " <td>$hash_ref->{custno}</td>\n";
print " </tr>\n";
}
print "</table>";
1
2
3
4
5
my @names = $sth->{NAMES};
print "<table border=1>\n".join("",map{'<th>'.$_.'<th>'}@names);
while(my @row = $sth->fetchrow_array()){
print "<tr>".join("",map{'<td>'.$_.'</td>'}@row)."</tr>";
}
print " <td><a target='_blank' href='gui1.pl?level=get_by_custno;custno=$hash_ref->{custno}'>$hash_ref->{custno}</a></td>\n";
1
2
3
4
5
6
7
8
my @names = @{$sth->{NAMES}};
print "<table border=1>\n".join("",map{'<th>'.$_.'<th>'}@names);
while(my $row = $sth->fetchrow_hashref()){
print "<tr>".join("",map{'<td>'.$_.'</td>'}@{$row}{@names})."</tr>";
for my $name(@names){
push @{$hash{$name}},$row->{$name};
}
}
7 Einträge, 1 Seite |