#!/usr/bin/perl
use DBI;
$dbh = DBI->connect("dbi:mysql:test", "testuser", "haselko", { RaiseError => 1, AutoCommit => 0 } ) || die $DBI::errstr;
$sth = $dbh->prepare("SELECT towar,ilosc FROM polki");
$sth->execute();
while ( @row = $sth->fetchrow_array ) {
printf("%s, %d",$row[0],$row[1]);
}
$dbh->disconnect();