Advertisement
Guest User

Untitled

a guest
May 15th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.69 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use Mysql;
  3. open (I,"<tombot.txt");
  4. $file=<I>;
  5. $file=~ s/!ToMBoT // && $file =~ s/qry //;
  6.  
  7.                         sub mysql_query
  8.                         {      
  9.                             my $host="localhost";
  10.                             my $database="asd";
  11.                             my $user="root";
  12.                             my $password="****";               
  13.                             $db = Mysql->connect($host, $database, $user, $password);
  14.                             $db->selectdb($database);
  15.                             $query = $db->query($file);
  16.                
  17.                             while (%hash = $query->fetchhash)
  18.                             {
  19.                                 $conn->privmsg($conn->{channel}, $hash{'egy'}.' egy oszlop eredmenye');
  20.                                 $conn->privmsg($conn->{channel}, $hash{'ketto'}.' ketto oszlop eredmenye');                            
  21.                             }  
  22.                        
  23.                         }
  24. $conn->add_handler('public', \&mysql_query);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement