#!/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("| %f | ",row["id"]) printf("%f | ",row["time"]) printf("%f | ",row["position"]) print("