#!/usr/koeki/bin/ruby $KCODE = 'e' require 'pg' require 'cgi' cgi = CGI.new("html4") print("Content-type: text/html; charset=EUC-JP\n\n") pghost = "localhost" pgport = 5432 pgoptions = nil pgtty = nil dbname = "ta05001" dbuser = "postgres" passwd = nil conn = PGconn.connect(pghost,pgport,pgoptions,pgtty,dbname,dbuser,passwd) sql = "SELECT * from position " tuple = conn.exec( sql ) pos = cgi["pos"] print("\n") print("\n") print("\n") print("データ一覧") print("\n") print("\n") print("\n") print("

\n") print("位置") print("

\n") print("") tuple.each do |row| if pos < row["position"] print("") printf("",row["id"]) printf("",row["time"]) printf("",row["position"]) print("\n") end end print("
%f%f%f
") print("\n") print("\n") tuple.clear conn.close