use DBI; #### MY SQL $dbhost = "10.1.1.15"; $dbh = undef; $db = "ip_track"; $user = "mysql"; $pass = "mysql_admin"; $connect = "DBI:mysql:database=$db;$dbhost:3306"; #### EO MYSQL $dbh = undef; $query = undef; $sth = undef; $ect = 0; @row = (); $dbok = 1; $dbh = DBI->connect($connect,$user,$pass, { PrintError => 1, RaiseError => 0, AutoCommit => 1 }) or warn "DBERR: $DBI::errstr \"" . __LINE__ . "\n"; $query = "SELECT cllseen FROM tblipdec where clipdec = ?"; if($debug == 1) { print "QUERY: \"$query\"\n"; } $sth = $dbh->prepare($query); $sth->execute($ipdec); my $mts = undef; $sth->bind_columns(undef, \$mts); while(@row = $sth->fetchrow_array()) { $ect++; } $sth->finish; $dbh->disconnect; if($debug == 1) { print "ECT: \"$ect\"\n"; } if($debug == 1) { print "MTS: \"$mts\"\n"; }