Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl -w
- use strict;
- use DBI;
- use Data::Dumper;
- my $dbhost = 'localhost';
- my $db = 'correio';
- my $dbuser = 'exim';
- my $dbpass = 'eximuser';
- my $dbport = '3306';
- my $dsn = "DBI:mysql:database=$db;host=$dbhost;port=$dbport";
- my $haha = &getinfacc('fabricio@ofertaperfeita.com.br');
- foreach my $h (@{$haha}) {
- foreach my $rs (keys %{$h}) {
- print "$rs -> $h->{$rs}\n";
- }
- }
- #it's gonna get all information about the user
- sub getinfacc {
- if (@_ and @_ == 1) {
- my $account = shift;
- my $dbc = DBI->connect($dsn, $dbuser, $dbpass);
- my $sel = $dbc->prepare("SELECT * FROM users where email=\'$account\'");
- $sel->execute;
- return $sel->fetchall_arrayref({});
- $dbc->disconnect;
- } else {
- return 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement