Skip to content

Instantly share code, notes, and snippets.

@gtsafas
Created September 15, 2011 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gtsafas/1219198 to your computer and use it in GitHub Desktop.
Save gtsafas/1219198 to your computer and use it in GitHub Desktop.
DBIx::Connector issue
my $con = DBIx::Connector->new("dbi:mysql:database=$db_admin_db;host=$db_admin_server;port=$db_port;mysql_socket=$socket_path", $db_admin_user, $db_admin_password,{ RaiseError => 1, AutoCommit => 1, mysql_auto_reconnect => 0 } );
my $emails = "";
$con->run(fixup => sub {
$emails = "";
my $sth = $_->prepare("select distinct U.email from applications T, users U where T.application=? and T.event=? and (U.access & (1<<(T.id-1)) <> 0) and U.client_of=?");
$sth->execute($app,$type,$client_of);
while (my $row = $sth->fetchrow_arrayref()) {
if ($emails ne "") {
$emails .= ",";
}
$emails .= $row->[0];
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment