SQLite - Perl

Perl 通过 DBI + DBD::SQLite 访问:DBI->connect('dbi:SQLite:dbname=test.db')。

Intermediate
Key PointsSQLite,Perl,DBI,DBD::SQLite,连接

讲解

Perl 通过 DBI + DBD::SQLite 访问:DBI->connect('dbi:SQLite:dbname=test.db')。

示例

PERL
use DBI;
my $dbh = DBI->connect("dbi:SQLite:dbname=test.db", "", "");
my $sth = $dbh->prepare("SELECT name FROM company WHERE id = ?");
$sth->execute(1);
my ($name) = $sth->fetchrow_array;
Output
-- cpan 安装 DBD::SQLite 后即可运行

Friends & Partners