+ my $sth = $dbh->prepare(qq{
+ select * from pGinaSession where ipaddress = ? and logoutstamp is null order by loginstamp desc
+ }) or die "prepare statement failed: $dbh->errstr()";
+ $sth->execute($ip) or die "execution failed: $dbh->errstr()";
+ if ( $sth->rows < 1 ) {
+ die "can't find IP for job";
+ } elsif ( $sth->rows > 1 ) {
+ warn "ERROR: found $sth->rows() rows usng first one\n";
+ }
+ my $row = $sth->fetchrow_hashref();
+ warn "## row = ",dump($row) if $debug;
+
+ $sth->finish;