Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use Mysql;
- open (I,"<tombot.txt");
- $file=<I>;
- $file=~ s/!ToMBoT // && $file =~ s/qry //;
- sub mysql_query
- {
- my $host="localhost";
- my $database="asd";
- my $user="root";
- my $password="****";
- $db = Mysql->connect($host, $database, $user, $password);
- $db->selectdb($database);
- $query = $db->query($file);
- while (%hash = $query->fetchhash)
- {
- $conn->privmsg($conn->{channel}, $hash{'egy'}.' egy oszlop eredmenye');
- $conn->privmsg($conn->{channel}, $hash{'ketto'}.' ketto oszlop eredmenye');
- }
- }
- $conn->add_handler('public', \&mysql_query);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement