#!/usr/bin/perl #-------------------- # program-ID:pet22.cgi # auther :nakamoto hiroyuki # date :2001/02/6 #-------------------- use CGI; use DBI; $query=new CGI; $txt01 = $query->param('TXT01'); $username="egi"; $dbh = DBI->connect("dbi:Pg:dbname=egi",$username) or die "cannot prepare: " , $DBI->errstr(); $sth = $dbh->prepare("$txt01") or die "cannot prepare: " , $dbh->errstr(); $sth->execute() or die "cannot execute: " , $sth->errstr(); print "content-type: text/html\n\n"; print "<HTML>\n"; print "<HEAD>\n"; print "<TITLE>検索結果</TITLE>\n"; print "</HEAD>\n"; print "<BODY bgcolor=LINEN>\n"; print "<center>\n"; print "<H3><font color=red>\n"; print ".......データベースの検索結果.......\n"; print "</font><H3>\n"; print "</center>\n"; #print "<p>\n"; print "<BR>\n"; print "<HR>\n"; @rows = $sth->rows; print "<h4>\n"; print "<font color=red>\n"; print "検索数 : @rows 件\n"; print "</font>"; print "</h4>\n"; print "<HR>\n"; print "<H4>\n"; while( @row = $sth->fetchrow_array()){ print "@row\n"; print "<BR>\n"; } print "<HR>\n"; print "</BODY>\n"; print "</HTML>\n";