#!/usr/bin/perl  -w

use DBI;

$ovladac="DBI:mysql";
$databaze="test";

my $dbh=DBI->connect("$ovladac:database=$databaze", "xpribyla", "") or die "Nepovedlo se spojení!!!";
#$dbh->do("USE test");

$dbh->do("CREATE TABLE Osa (Autor text, Prispevek text)");
$dbh->do("INSERT INTO Osa (Autor, Prispevek) VALUES ('anonym', 'nevím, co sem napsat')");
my $sth = $dbh->prepare("SELECT * FROM Osa");
$sth->execute();
my $ref = $sth->fetchrow_hashref();
print "$ref->{'Autor'} $ref->{'Prispevek'}\n";
$sth->finish();
$dbh->do("DELETE FROM Osa WHERE Autor='anonym'");
$dbh->do("DROP TABLE Osa");

$dbh->disconnect;

exit;