Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: the multiple thread port scanner scripts issue

by roboticus (Chancellor)
on Jan 26, 2013 at 14:34 UTC ( #1015493=note: print w/replies, xml ) Need Help??

in reply to the multiple thread port scanner scripts issue


The reason that the date isn't being updated in your database is because you're not telling it to do so. I'd change your update statement from:

my $upd_sth = $dbh->prepare("update psinfo set port=\'$myport\' where +domainname=\'$line\'"); $upd_sth->execute() or die "unable to execute update line where name i +s $line! error $DBI::errstr";

to something like this:

my $upd_sth = $dbh->prepare(q{ update psinfo set port=?, last_checked=getdate() where domainname=? }); $upd_sth->execute($myport, $line) or die "unable to update: name=$line! error\n$DBI::errstr\n";

Note: I don't recall the method to get the current date/time in MSSQL, so I just guessed. I also converted your code to use placeholders, because:

  • they're safer,
  • they're easy to use
  • they make the SQL more readable (in my opinion)

I'm sorry, but I can't quite make out all of your question, nor can I make much sense from your code, so that's about all I can offer for now.


When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^2: the multiple thread port scanner scripts issue
by jeremy.fang (Initiate) on Jan 28, 2013 at 07:13 UTC
    thanks your reply
    can you added the thread into the scripts

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1015493]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2018-03-17 19:14 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (225 votes). Check out past polls.