kevin0490 发表于 2015-12-28 11:46:59

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]
查看完整版本: Perl 数据库操作