#!/usr/bin/perl use DBI; my $host = "localhost"; my $database = "mysql"; my $user = "usernev"; my $pw = "titok"; my $port = 3036; my $dsn = "DBI:mysql:database=$database;host=$host;port=$port"; my $dbh = DBI->connect($dsn, $user, $pw); $sth = $dbh->prepare("SELECT * FROM user"); $sth->execute; $numRows = $sth->rows; print $numRows."\n"; while (my $ref = $sth->fetchrow_hashref()) { print "Sor: id = $ref->{'User'}, Név = $ref->{'Host'}\n"; } $sth->finish;