#!/usr/bin/perl #--------------- # program-ID:pet15.egi # auther :tokuda # date :2002/01/22 #----------------------- use CGI; use DBI; #-------------- $username="egi"; $dbh = DBI->connect("dbi:Pg:dbname=egi",$username) or die "cannot connect: " , $DBI->errstr; print "content-type: text/html\n\n"; #$iselect = "select bango, name, type.pet_list, owner from pet_list, pet_info # where type.pet_info = bangou"; $iselect = "select bangou, animal, type from pet_list order by bangou"; $sth =$dbh->prepare($iselect) or die "cannot prepare: " , $dbh->errstr(); $sth->execute() or die "cannot execute: " , $sth->errstr(); #------------- print "<HTML>\n"; print "<HEAD><TITLE>select</TITLE>\n"; print "<META HTTP-EQUIV=\"content-type\" CONTENT=\"text/html;charset=EUC-JP\">\n"; print "</HEAD>\n"; print "<BODY BGCOLOR=LINEN >\n"; print "<CENTER>\n"; print "ペット情報の検索\n"; print "<HR>\n"; print "<H4>\n"; print "表示したいペット番号をクリックして下さい。\n"; print "<P>\n"; print "<TABLE BORDER = 1 BGCOLOR=POWDERBLUE >\n"; print "<TR>"; print "<TH>番号</TH>"; print "<TH>動物種</TH>"; print "<TH>種類</TH>"; print "</TR>\n"; print "<br>\n"; while(@row = $sth->fetchrow_array() ){ print "<TR>"; print "<TD><A HREF=./pet16.cgi?ibango=$row[0]>$row[0]</A></TD>"; print "<TD>$row[1]</TD>"; print "<TD>$row[2]</TD>"; print "</TR>\n"; } print "</TABLE>\n"; print "<P>\n"; print "<P>\n"; print "<A HREF=../index.html>もどる</A>\n"; print "</CENTER>\n"; print "</BODY>\n"; print "</HTML>\n";