Guest User

Untitled

a guest
Jul 1st, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.56 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. use strict;
  4. use warnings;
  5. use DBI;
  6. use CGI;
  7. use Try::Tiny;
  8.  
  9. my $db = "magnian1_ncls2";
  10. my $username = "xxx";
  11. my $password = "yyy";
  12.  
  13. my $q = CGI->new;
  14.  
  15. print $q->header, $q->start_html('Test: '); try {
  16.  
  17. my $dsn = "DBI:mysql:database=$db;host=localhost;";
  18.  
  19. my $dbh = DBI->connect($dsn, $username, $password, {RaiseError => 1} );
  20.  
  21. my $sth = $dbh->prepare(q{
  22.     SELECT memberid,field,value FROM nucleus_plugin_profile WHERE field = ? AND value = ?;
  23.   });
  24.   $sth->execute("membership",2);  } catch { print "Error: $_" }; print $q->end_html
Add Comment
Please, Sign In to add comment