Hi,
I used the code:
sub set_min{
$host = shift;
$date = shift;
print "The host is $host and the date is $date\nIn the function
set_min\n";
$host = SOX::get_db_host();
$user = SOX::get_db_user();
$passwd = SOX::get_db_passwd();
$db = DBI-> connect ( $host, $user, $passwd, {'AutoCommit' => 0,
'PrintError' => (not $debug), 'RaiseError' => $debug } );
my $insert_query = qq{
UPDATE hosts SET last_checked = '$date' WHERE hostname =
'$host';
};
$sth = $db -> prepare($insert_query)
or die "Could not prepare the statement: ".$db -> errstr;;
$sth -> execute or die "Could not execute query\n";
$sth -> finish;
$db -> commit();
$db -> disconnect();
}
The code runs without any warnings/errors, but the database is not touched.
What is wrong?
Thanks.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/