Perl 数据库操作
当作偶尔练习,同时做个记录。小案例还是比较有用的。#!/usr/bin/perl
use DBI;
#connect
my $dbh=DBI->connect("DBI:mysql:database=db;host=localhost","root","password",{'RaiseError'=>1});
#select
my $sth =$dbh->prepare("select * from people");
$sth->execute();
#clean up
$dbh->disconnect();
页:
[1]