#!/usr/bin/perl use Pg; use strict; use DBI; my $sth; my $status; my $sql_insert; my $pidm; my $location = "keypad"; my $time = "now"; my $year = "2002"; my $dbname = "chipdb"; # must pass the pidm to this script $pidm = 53; # inputing to the database from here $sql_insert = "INSERT INTO here_now VALUES ($pidm, $location, $time)" $dbh = DBI->connect("dbi:Pg:dbname=$dbname") || die "test.pl - Can't connect, $DBI::errstr"; print "Connected\n"; $sth = $dbh->prepare($sql_insert) || die "test.pl - prepare error: ($sql) $DBI::errstr"; $status = $sth->execute || die "test.pl - execute error: ($sql) status=$status $DBI::errstr";