#!/usr/bin/perl #----------------------- # program-ID:pet31.cgi # auther :t-egi # date :2002/1/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 banngo, name, type, owner from pet_info order by banngo"; $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 HETTP-EQUIV=\"Content-Type\" CONTENT=\"text/html;charset=EUC-JP\"\n"; print "</HEAD>\n"; print "<BODY bgcolor=LINEN>\n"; print "<CENTER>\n"; print "<H4>\n"; print "ペット情報テーブルの管理\n<br>\n<HR>\n"; print "訂正するペットの番号をクリックして下さい。\n"; print "<br>\n"; print "<TABLE BORDER = 1 bgcolor = \"#98FBBB\">\n"; print "<TR bgcolor = PALEGREEN>"; print "<TH>番号</TH>"; 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=./pet32.cgi?ibango=$row[0]>$row[0]</A></TD>"; print "<TD>$row[1]</TD>"; print "<TD>$row[2]</TD>"; print "<TD>$row[3]</TD>"; print "</TR>\n"; } print "</TABLE>\n"; print "<P>\n"; print "<A HREF=\"./pet33.cgi\">新規追加 </A>\n"; print "<P>\n"; print "<A HREF=http://myouga.cs.ube-c.ac.jp/~egi/pet/index.html>戻る</A>\n"; print "</CENTER>\n"; print "</BODY>\n"; print "</HTML>\n";