summaryrefslogtreecommitdiffstats
path: root/bin/add_book.pl
blob: 13cf9345eb15ec953c1e084c3033b83393288374 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl -w

use warnings;
use strict;
use strict 'vars';

use DBI;

my $dbfile = 'ksiazki.db';
my $dbh = DBI->connect("dbi:SQLite:dbname=$dbfile", "", "");

my$sth=$dbh->prepare("select * from ksiazki where id=(select max(id) from ksiazki)");
$sth->execute;
(my @dupa)=$sth->fetchall_arrayref;
my $max_id =  ${$dupa[0]}[0][0];