User defined Action ( Data to specified Database )

Hi,

I’m trying to pass some information from RT system, to a database. I’ve
added the following code but I don’t seem to get any row result…does
anyone have any ideias ?

use DBI;
my $dbh = DBI->connect(‘dbi:mysql:database’,‘user’,‘pass’);
if (not $dbh) {
$RT::Logger->info(“Error connecting BD”);
}
my $sql = “select * from table”;
my $sth = $dbh->prepare($sql);
$sth->execute ||
$RT::Logger->info("Error executing SQL : ".$sql);
my $row;
while ($row=$sth->fetchrow_array) {
$RT::Logger->info("Row : ".$row);
}

Thanks

signature.asc (189 Bytes)