summaryrefslogtreecommitdiffstats
path: root/bin/test_sql.pl
diff options
context:
space:
mode:
Diffstat (limited to 'bin/test_sql.pl')
-rwxr-xr-xbin/test_sql.pl21
1 files changed, 21 insertions, 0 deletions
diff --git a/bin/test_sql.pl b/bin/test_sql.pl
new file mode 100755
index 0000000..5c4b2a3
--- /dev/null
+++ b/bin/test_sql.pl
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+
+use DBI;
+
+my $dbfile = 'a.db';
+my $dbh = DBI->connect("dbi:SQLite:dbname=$dbfile", "", "");
+
+#$dbh->do("create table abc (int a)");
+#$dbh->do("insert into abc values (7)");
+#print $dbh->do("select * from abc");
+
+
+#my $sth = $dbh->prepare("select * from abc"); # prepare the query
+#$sth->execute(); # execute the query
+#my @row;
+#while (@row = $sth->fetchrow_array) { # retrieve one row
+# print join("\n", @row), "\n";
+#}
+
+my $sth = $dbh->prepare ("update qwe set liczba=20 where id=2");
+$sth->execute();