summaryrefslogtreecommitdiffstats
path: root/bin/test_sql.pl
diff options
context:
space:
mode:
Diffstat (limited to 'bin/test_sql.pl')
-rw-r--r--bin/test_sql.pl9
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/test_sql.pl b/bin/test_sql.pl
new file mode 100644
index 0000000..b4cf6e1
--- /dev/null
+++ b/bin/test_sql.pl
@@ -0,0 +1,9 @@
+use DBI;
+
+my $dbfile = 'ksiazki.db';
+my $dbh = DBI->connect("dbi:SQLite:dbname=$dbfile", "", "");
+
+my $sth = $dbh->prepare("select * from ksiazki") or die "Nie mozna spreparowac zapytania";
+$sth->execute() or die "Nie mozna wykonac zapytania";
+
+print ${$sth->fetchall_arrayref}[1][2];